Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 869 Vote(s) - 3.44 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Programmatically installing & activating Wordpress plugins

#1
Is it possible, somehow to programmatically install plugins? So I can send my client one file they unpack, go to some installplugins.php file and that installs + activates them? Only way I found for doing that is really rancid lowlevel; I'm hoping someone here knows better methods.
Reply

#2
Looks like you can toggle plugins in the database: table wp_options -> field option_name -> active_plugins.
Reply

#3
1. Copy plugin to `/wp-content/plugins/` (root dir if the plugin is just one file, otherwise a subdir).
2. Call `activate_plugin('/full/path/to/your/plugin/php');`
Reply

#4
Here's a complete script; put in wp-admin, give it a .php suffix, and hit it via curl.

<?php

define('WP_ADMIN', TRUE);
define('WP_NETWORK_ADMIN', TRUE);
define('WP_USER_ADMIN', TRUE);

require_once('../wp-load.php');
require_once( '../wp-admin/includes/admin.php' );
require_once( '../wp-admin/includes/plugin.php' );

activate_plugin("/full/path/to/my/plugin.php");
?>
Reply

#5
Update
------

Today I use a shell loop with [wp-cli](

[To see links please register here]

) to install and [activate](

[To see links please register here]

) the plugins

Original Answer
================

For activating, I use some variant of this. suppose I had three plugins i wanted to activate ("cforms", "w3-total-cache", "wordpress-seo"). The convention is that their directory and plugin .php file are the same name:

$wordpress_path = "/path/to/my/wordpress/install";
require_once( $wordpress_path . "/wp-load.php" ); //not sure if this line is needed
//activate_plugin() is here:
require_once( $wordpress_path . "/wp-admin/includes/plugin.php");
$plugins = array("cforms", "w3-total-cache", "wordpress-seo");
foreach ($plugins as $plugin){
$plugin_path = $wordpress_path."wp-content/plugins/{$plugin}.php";
activate_plugin($plugin_path);
}
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through