This commit is contained in:
thanghv 2020-06-12 16:30:18 +07:00
parent 2a0cad9f51
commit 3d260e2565
7 changed files with 22 additions and 5 deletions

View file

@ -10,6 +10,9 @@
*
* The code is used for the MainWP Buddy Extension
* Extension URL: https://mainwp.com/extension/mainwpbuddy/
*
* @package MainWP\Child
*
*/
use MainWP\Child\MainWP_Helper;

View file

@ -11,6 +11,8 @@
*
* The code is used for the MainWP iThemes Security Extension
* Extension URL: https://mainwp.com/extension/ithemes-security/
*
* @package MainWP\Child
*/
use MainWP\Child\MainWP_Helper;

View file

@ -9,6 +9,8 @@
namespace MainWP\Child;
//phpcs:disable Generic.Metrics.CyclomaticComplexity -- Required to achieve desired results, pull request solutions appreciated.
/**
* Class MainWP_Child_Posts
*
@ -815,7 +817,7 @@ class MainWP_Child_Posts {
* @param bool $is_post_plus TRUE|FALSE, Whether or not this came from MainWP Post Plus Extension.
*
* @uses \MainWP\Child\MainWP_Child_Posts::set_custom_post_fields()
* @uses \MainWP\Child\MainWP_Child_Posts::create_seo_extension_activated()
* @uses \MainWP\Child\MainWP_Child_Posts::update_seo_meta()
* @uses \MainWP\Child\MainWP_Child_Posts::create_set_categories()
* @uses \MainWP\Child\MainWP_Child_Posts::create_featured_image()
* @uses \MainWP\Child\MainWP_Child_Posts::post_plus_update_author()
@ -834,7 +836,7 @@ class MainWP_Child_Posts {
// yoast seo plugin activated.
if ( $seo_ext_activated ) {
$this->create_seo_extension_activated( $new_post_id, $post_custom );
$this->update_seo_meta( $new_post_id, $post_custom );
}
$this->create_set_categories( $new_post_id, $post_category, $post_to_only_existing_categories );
@ -1233,7 +1235,7 @@ class MainWP_Child_Posts {
* @uses \WPSEO_Meta::$meta_prefix()
* @uses \Exception()
*/
private function create_seo_extension_activated( $new_post_id, $post_custom ) {
private function update_seo_meta( $new_post_id, $post_custom ) {
$_seo_opengraph_image = isset( $post_custom[ \WPSEO_Meta::$meta_prefix . 'opengraph-image' ] ) ? $post_custom[ \WPSEO_Meta::$meta_prefix . 'opengraph-image' ] : array();
$_seo_opengraph_image = current( $_seo_opengraph_image );

View file

@ -733,7 +733,7 @@ class MainWP_Child_Stats {
$uploadDir = $uploadDir[0];
$popenHandle = popen( 'du -s ' . $directory . ' --exclude "' . str_replace( ABSPATH, '', $uploadDir ) . '"', 'r' ); // phpcs:ignore -- run if enabled.
if ( 'resource' === gettype( $popenHandle ) ) {
$size = fread( $popenHandle, 1024 );
$size = fread( $popenHandle, 1024 ); //phpcs:ignore -- custom read file.
pclose( $popenHandle );
$size = substr( $size, 0, strpos( $size, "\t" ) );
if ( $size && MainWP_Helper::ctype_digit( $size ) ) {

View file

@ -3,6 +3,8 @@
* MainWP Updraft Plus Backups
*
* This code is used for the MainWP UpdraftPlus Extension.
*
* @package MainWP\Child
*/
use MainWP\Child\MainWP_Helper;

View file

@ -17,6 +17,11 @@ namespace MainWP\Child;
*/
class MainWP_Client_Report_Base {
/**
* Public static variable to hold the single instance of the class.
*
* @var mixed Default null
*/
public static $instance = null;
/**

View file

@ -1,6 +1,9 @@
<?php
/**
* Plugin Name: MainWP Child
*
* Description: Provides a secure connection between your MainWP Dashboard and your WordPress sites. MainWP allows you to manage WP sites from one central location.
*
* Plugin URI: https://mainwp.com/
* Description: Provides a secure connection between your MainWP Dashboard and your WordPress sites. MainWP allows you to manage WP sites from one central location. Plugin documentation and options can be found here https://mainwp.com/help/
* Author: MainWP
@ -14,7 +17,7 @@
require_once ABSPATH . 'wp-includes' . DIRECTORY_SEPARATOR . 'version.php'; // Version information from WordPress.
/**
* Define MainWP Child Plugin Debug Mode. Default: true.
* Define MainWP Child Plugin Debug Mode. Default: false.
*/
define( 'MAINWP_CHILD_DEBUG', false );