diff --git a/wp-content/plugins/wp-maximum-upload-file-size/admin/class-wmufs-admin.php b/wp-content/plugins/wp-maximum-upload-file-size/admin/class-wmufs-admin.php new file mode 100644 index 000000000..24b700fd7 --- /dev/null +++ b/wp-content/plugins/wp-maximum-upload-file-size/admin/class-wmufs-admin.php @@ -0,0 +1,188 @@ + admin_url('admin-ajax.php'), + 'nonce' => $admin_notice_nonce, + ) + ); + } + + + // get plugin version from header + static function get_plugin_version() { + $plugin_data = get_file_data(__FILE__, array( 'version' => 'Version' ), 'plugin'); + + return $plugin_data['version']; + } // get_plugin_version + + + // test if we're on plugin's page + static function is_plugin_page() { + $current_screen = get_current_screen(); + + if ( $current_screen->id == 'media_page_upload_max_file_size' ) { + return true; + } else { + return false; + } + } // is_plugin_page + + + // add settings link to plugins page + static function plugin_action_links( $links ) { + $settings_link = 'Settings'; + + array_unshift($links, $settings_link); + + return $links; + } // plugin_action_links + + + // add links to plugin's description in plugins table + static function plugin_meta_links( $links, $file ) { + $support_link = 'Support'; + + + if ( $file == plugin_basename(__FILE__) ) { + $links[] = $support_link; + } + + return $links; + } // plugin_meta_links + + + // additional powered by text in admin footer; only on plugin's page + static function admin_footer_text( $text ) { + if ( ! self::is_plugin_page() ) { + return $text; + } + + $text = ''; + return $text; + } // admin_footer_text + + + /** + * Add menu pages + * + * @since 1.0 + * + * @return null + * + */ + static function upload_max_file_size_add_pages() { + // Add a new menu on main menu + add_submenu_page( + 'upload.php', // Parent Slug. + 'Increase Max Upload File Size', // Page Title. + 'Increase Upload Limit', // Menu Title + 'manage_options', + 'upload_max_file_size', + [ __CLASS__, 'upload_max_file_size_dash' ] + ); + + } + + /** + * Get closest value from array + * @param $search + * @param $arr + * @return mixed|null + */ + static function get_closest( $search, $arr ) { + $closest = null; + foreach ( $arr as $item ) { + if ( $closest === null || abs($search - $closest) > abs($item - $search) ) { + $closest = $item; + } + } + return $closest; + } // get_closest + + + /** + * Dashboard Page + */ + static function upload_max_file_size_dash() { + + include_once(WMUFS_PLUGIN_PATH . 'inc/class-wmufs-helper.php'); + include_once WMUFS_PLUGIN_PATH . 'admin/templates/class-wmufs-template.php'; + + add_action('admin_head', [ __CLASS__, 'wmufs_remove_admin_action' ]); + } + + + /** + * Remove admin notices in admin page. + * + * @return array|mixed. + */ + static function wmufs_remove_admin_action() { + remove_all_actions('user_admin_notices'); + remove_all_actions('admin_notices'); + } + + /** + * Filter to increase max_file_size + * + * @since 1.4 + * + * @return int max_size in bytes + * + */ + static function upload_max_increase_upload( $data ) { + return get_option('max_file_size') ? get_option('max_file_size') : $data; + } + + +} + +/** + * Instance of the class // Codepopular_WMUFS + */ +add_action('init', array( 'Codepopular_WMUFS', 'init' )); diff --git a/wp-content/plugins/wp-maximum-upload-file-size/admin/templates/class-wmufs-sidebar.php b/wp-content/plugins/wp-maximum-upload-file-size/admin/templates/class-wmufs-sidebar.php new file mode 100644 index 000000000..7b99841b3 --- /dev/null +++ b/wp-content/plugins/wp-maximum-upload-file-size/admin/templates/class-wmufs-sidebar.php @@ -0,0 +1,49 @@ + + + +
+
+
+
+
+
+ '; + echo $notice; + echo '
'; + echo ' ' . $this->client->__trans( 'Allow' ) . ''; + echo ' ' . $this->client->__trans( 'No thanks' ) . ''; + echo '
+ client->__trans( 'We share your data with Appsero to troubleshoot problems & make product improvements. Learn more about how Appsero handles your data.' ), + esc_url( 'https://appsero.com/' ), + esc_url( 'https://appsero.com/privacy-policy' ) + ); + ?> +
++ client->__trans( 'Activate %s by your license key to get professional support and automatic update from your WordPress dashboard.' ), $this->client->name ); ?> +
+ + + show_active_license_info( $license ); + } + ?> +client->_etrans( 'Unlimited' ); ?>
+ ++ client->__trans( '%1$d out of %2$d' ), $license['remaining'], $license['activation_limit'] ); ?> +
+ +' . $license['expiry_days'] . ' days
'; + } else { + echo '' . $this->client->__trans( 'Never' ) . '
'; + } + ?> +error; ?>
+success; ?>
+