83% mainwp-child

Code Review | MainWP Child - Securely Connects Sites to the MainWP WordPress Manager Dashboard

WordPress plugin MainWP Child - Securely Connects Sites to the MainWP WordPress Manager Dashboard scored83%from 54 tests.

About plugin

  • Plugin page: mainwp-child
  • Plugin version: 4.5.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.3.2
  • WordPress version: 6.3.1
  • First release: Aug 27, 2013
  • Latest release: Nov 6, 2023
  • Number of updates: 493
  • Update frequency: every 7.6 days
  • Top authors: mainwp (100%)

Code review

54 tests

User reviews

63 reviews

Install metrics

600,000+ active /22,724,577 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲6.19MB] [CPU: ▲34.05ms] 50% from 4 tests

Server-side resources used by MainWP Child - Securely Connects Sites to the MainWP WordPress Manager Dashboard
Please fix the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 1,285.87ms on /wp-admin/options-general.php?page=mainwp_child_tab)
  • Extra RAM: The extra memory usage should kept under 5MB (currently 6.19MB on /wp-admin/options-general.php?page=mainwp_child_tab)
PageMemory (MB)CPU Time (ms)
Home /9.46 ▲5.9971.96 ▲29.01
Dashboard /wp-admin9.57 ▲6.2684.80 ▲32.70
Posts /wp-admin/edit.php9.61 ▲6.2680.52 ▲29.57
Add New Post /wp-admin/post-new.php12.15 ▲6.26145.97 ▲44.90
Media Library /wp-admin/upload.php9.49 ▲6.2681.15 ▲45.94
MainWP Child /wp-admin/options-general.php?page=mainwp_child_tab9.671,285.87

Server storage [IO: ▲4.18MB] [DB: ▲0.00MB] Passed 3 tests

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 487 new files
Database: no new tables, 12 new options
New WordPress options
mainwp_child_branding_settings
widget_recent-comments
can_compress_scripts
db_upgraded
mainwp_cache_control_cache_solution
widget_recent-posts
theysaidso_admin_options
mainwp_child_auth
widget_theysaidso_widget
mainwp_child_update_version
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for MainWP Child - Securely Connects Sites to the MainWP WordPress Manager Dashboard
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲4814.35 ▲0.281.99 ▲0.2841.81 ▼0.61
Dashboard /wp-admin2,215 ▲385.63 ▼0.0195.60 ▼8.6543.55 ▼1.36
Posts /wp-admin/edit.php2,120 ▲201.94 ▼0.0740.44 ▲0.4737.96 ▼0.73
Add New Post /wp-admin/post-new.php1,544 ▲1822.18 ▼0.65672.97 ▲38.2650.74 ▲0.33
Media Library /wp-admin/upload.php1,420 ▲264.20 ▼0.1199.52 ▼2.0545.20 ▲3.81
MainWP Child /wp-admin/options-general.php?page=mainwp_child_tab2,1742.3131.9733.12

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 11 options
    • db_upgraded
    • widget_recent-posts
    • mainwp_child_auth
    • widget_recent-comments
    • widget_theysaidso_widget
    • mainwp_child_update_version
    • can_compress_scripts
    • mainwp_child_actions_data_checked
    • mainwp_cache_control_cache_solution
    • theysaidso_admin_options
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 172× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\EC\\BaseCurves\\Prime' not found in wp-content/plugins/mainwp-child/libs/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/brainpoolP512r1.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\Common\\Formats\\Keys\\PKCS8' not found in wp-content/plugins/mainwp-child/libs/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Crypt/DH/Formats/Keys/PKCS8.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\EC\\BaseCurves\\Base' not found in wp-content/plugins/mainwp-child/libs/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Prime.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\RSA' not found in wp-content/plugins/mainwp-child/libs/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/PrivateKey.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\Common\\BlockCipher' not found in wp-content/plugins/mainwp-child/libs/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php:47
    • > PHP Fatal error
      Uncaught Error: Interface 'phpseclib3\\Crypt\\Common\\PrivateKey' not found in wp-content/plugins/mainwp-child/libs/phpseclib/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent/Identity.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\EC\\BaseCurves\\Binary' not found in wp-content/plugins/mainwp-child/libs/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/sect233r1.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\EC\\BaseCurves\\Prime' not found in wp-content/plugins/mainwp-child/libs/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/secp521r1.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\Common\\Formats\\Keys\\PKCS8' not found in wp-content/plugins/mainwp-child/libs/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PSS.php:37
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\EC\\Curves\\secp521r1' not found in wp-content/plugins/mainwp-child/libs/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/nistp521.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
You can look at the official readme.txt

mainwp-child/mainwp-child.php 85% from 13 tests

The primary PHP file in "MainWP Child - Securely Connects Sites to the MainWP WordPress Manager Dashboard" version 4.5.3 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 223 characters long)
  • Requires at least: Required version must be the same as the one declared in readme.txt ("6.2" instead of "5.4")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected69,371 lines of code in 436 files:
LanguageFilesBlank linesComment linesLines of code
PHP41812,95238,14866,937
PO File68301,8481,849
JSON500421
Markdown3580140
XML10019
Bourne Shell1203
CSS22102

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
These items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 147)
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity31.46
▷ Minimum class complexity1.00
▷ Maximum class complexity870.00
Average method complexity5.23
▷ Minimum method complexity1.00
▷ Maximum method complexity147.00
Code structure
Namespaces42
Interfaces3
Traits4
Classes399
▷ Abstract classes20852.13%
▷ Concrete classes19147.87%
▷ Final classes2513.09%
Methods2,883
▷ Static methods84829.41%
▷ Public methods2,17275.34%
▷ Protected methods30810.68%
▷ Private methods40313.98%
Functions36
▷ Named functions925.00%
▷ Anonymous functions2775.00%
Constants340
▷ Global constants175.00%
▷ Class constants32395.00%
▷ Public constants323100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
30 PNG files occupy 0.07MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/1.10.4/images/ui-icons_2e83ff_256x240.png4.44KB4.17KB▼ 6.02%
css/1.11.1/images/ui-bg_glass_100_f6f6f6_1x400.png0.29KB0.12KB▼ 59.47%
css/1.11.1/images/ui-bg_highlight-soft_75_ffe45c_1x100.png0.36KB0.18KB▼ 48.50%
css/1.11.1/images/ui-icons_ef8c08_256x240.png4.49KB4.18KB▼ 6.89%
css/1.11.1/images/ui-icons_ffffff_256x240.png6.32KB4.18KB▼ 33.80%