mirror of
https://github.com/mainwp/mainwp-child.git
synced 2025-09-07 11:16:40 +08:00
[CodeFactor] Apply fixes
[ci skip] [skip ci]
This commit is contained in:
parent
e758ee489e
commit
635f617694
5 changed files with 330 additions and 324 deletions
|
@ -8,6 +8,7 @@ namespace MainWP\Child;
|
|||
|
||||
/**
|
||||
* Class MainWP_Child_Comments
|
||||
*
|
||||
* @package MainWP\Child
|
||||
*/
|
||||
class MainWP_Child_Comments {
|
||||
|
@ -122,7 +123,7 @@ class MainWP_Child_Comments {
|
|||
* @param $clauses MySQL WHERE Clause.
|
||||
* @return array $clauses, Array of MySQL WHERE Clauses.
|
||||
*/
|
||||
public function comments_clauses($clauses ) {
|
||||
public function comments_clauses( $clauses ) {
|
||||
if ( $this->comments_and_clauses ) {
|
||||
$clauses['where'] .= ' ' . $this->comments_and_clauses;
|
||||
}
|
||||
|
@ -182,7 +183,7 @@ class MainWP_Child_Comments {
|
|||
* @param $pCount Comment count.
|
||||
* @return array $allComments Array of all comments found.
|
||||
*/
|
||||
public function get_recent_comments($pAllowedStatuses, $pCount ) {
|
||||
public function get_recent_comments( $pAllowedStatuses, $pCount ) {
|
||||
if ( ! function_exists( 'get_comment_author_url' ) ) {
|
||||
include_once WPINC . '/comment-template.php';
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace MainWP\Child;
|
|||
|
||||
/**
|
||||
* Class MainWP_Child_Plugins_Check
|
||||
*
|
||||
* @package MainWP\Child
|
||||
*/
|
||||
class MainWP_Child_Plugins_Check {
|
||||
|
@ -98,7 +99,7 @@ class MainWP_Child_Plugins_Check {
|
|||
* (0 indicates no events were registered with the hook and arguments combination),
|
||||
* false if un-scheduling one or more events fail.
|
||||
*/
|
||||
public function cleanup_deactivation($del = true ) {
|
||||
public function cleanup_deactivation( $del = true ) {
|
||||
$this->cleanup_basic();
|
||||
wp_clear_scheduled_hook( $this->cron_name_watcher );
|
||||
delete_option( $this->option_name_last_daily_run );
|
||||
|
@ -114,7 +115,7 @@ class MainWP_Child_Plugins_Check {
|
|||
* @param string $action Action to perform: query_plugins.
|
||||
* @return \stdClass $args Modified Search Query.
|
||||
*/
|
||||
public function modify_plugin_api_search_query($args, $action ) {
|
||||
public function modify_plugin_api_search_query( $args, $action ) {
|
||||
if ( isset( $action ) && 'query_plugins' === $action ) {
|
||||
|
||||
if ( ! is_object( $args ) ) {
|
||||
|
@ -313,7 +314,7 @@ class MainWP_Child_Plugins_Check {
|
|||
* @param $second_pass
|
||||
* @return bool|string true|false The body of the response. Empty string if no body or incorrect parameter given.
|
||||
*/
|
||||
private function try_get_response_body($plugin, $second_pass ) {
|
||||
private function try_get_response_body( $plugin, $second_pass ) {
|
||||
|
||||
// Get the WordPress current version to be polite in the API call.
|
||||
include ABSPATH . WPINC . '/version.php';
|
||||
|
|
|
@ -26,6 +26,7 @@ require_once ABSPATH . '/wp-admin/includes/plugin.php';
|
|||
|
||||
/**
|
||||
* Class MainWP_Child
|
||||
*
|
||||
* @package MainWP\Child
|
||||
*/
|
||||
class MainWP_Child {
|
||||
|
@ -53,9 +54,10 @@ class MainWP_Child {
|
|||
|
||||
/**
|
||||
* MainWP_Child constructor.
|
||||
*
|
||||
* @param $plugin_file MainWP Child Plugin file.
|
||||
*/
|
||||
public function __construct($plugin_file ) {
|
||||
public function __construct( $plugin_file ) {
|
||||
$this->update();
|
||||
$this->load_all_options();
|
||||
|
||||
|
@ -323,9 +325,10 @@ class MainWP_Child {
|
|||
|
||||
/**
|
||||
* Hook to deactivate MainWP Child Plugin.
|
||||
*
|
||||
* @param bool $deact Whether or not to deactivate pugin. Default: true.
|
||||
*/
|
||||
public function deactivation($deact = true ) {
|
||||
public function deactivation( $deact = true ) {
|
||||
|
||||
$mu_plugin_enabled = apply_filters( 'mainwp_child_mu_plugin_enabled', false );
|
||||
if ( $mu_plugin_enabled ) {
|
||||
|
|
|
@ -10,6 +10,7 @@ namespace MainWP\Child;
|
|||
|
||||
/**
|
||||
* Class MainWP_Clone_Install
|
||||
*
|
||||
* @package MainWP\Child
|
||||
*/
|
||||
class MainWP_Clone_Install {
|
||||
|
@ -133,7 +134,7 @@ class MainWP_Clone_Install {
|
|||
* @param $file Config.txt file path.
|
||||
* @return bool|string False or True on success. Return config.txt content on true.
|
||||
*/
|
||||
private function file_exists($file ) {
|
||||
private function file_exists( $file ) {
|
||||
if ( 'extracted' === $this->file ) {
|
||||
return file_get_contents( '../clone/config.txt' );
|
||||
}
|
||||
|
@ -240,7 +241,7 @@ class MainWP_Clone_Install {
|
|||
* @param $name Option name.
|
||||
* @param $value Option value to update.
|
||||
*/
|
||||
public function update_option($name, $value ) {
|
||||
public function update_option( $name, $value ) {
|
||||
|
||||
/** @var $wpdb wpdb */
|
||||
global $wpdb;
|
||||
|
@ -509,7 +510,7 @@ class MainWP_Clone_Install {
|
|||
* @param $mypath Path to files.
|
||||
* @param $arg chmod arguments.
|
||||
*/
|
||||
public function recurse_chmod($mypath, $arg ) {
|
||||
public function recurse_chmod( $mypath, $arg ) {
|
||||
$d = opendir( $mypath );
|
||||
while ( ( $file = readdir( $d ) ) !== false ) {
|
||||
if ( '.' !== $file && '..' !== $file ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue