74% wp-mega

Code Review | WP Mega

WordPress plugin WP Mega scored74%from 54 tests.

About plugin

  • Plugin page: wp-mega
  • Plugin version: 1.0
  • PHP compatiblity: 5.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.9.7
  • WordPress version: 6.3.1
  • First release: Aug 14, 2018
  • Latest release: Aug 14, 2018
  • Number of updates: 4
  • Update frequency: every 4.0 days
  • Top authors: nur1952 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /597 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼0.68MB] [CPU: ▼35.74ms] Passed 4 tests

A check of server-side resources used by WP Mega
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2245.43 ▲7.20
Dashboard /wp-admin3.27 ▼0.0426.91 ▼25.79
Posts /wp-admin/edit.php3.27 ▼0.0925.06 ▼26.30
Add New Post /wp-admin/post-new.php3.27 ▼2.6226.45 ▼77.68
Media Library /wp-admin/upload.php3.27 ▲0.0424.81 ▼13.17

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by WP Mega
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,889 ▲12814.38 ▲0.002.22 ▲0.4942.03 ▲1.32
Dashboard /wp-admin2,228 ▲515.56 ▲0.0386.40 ▼6.6237.63 ▼4.23
Posts /wp-admin/edit.php2,180 ▲802.02 ▲0.0045.65 ▲6.1137.56 ▼1.39
Add New Post /wp-admin/post-new.php1,553 ▲2723.15 ▼0.35674.02 ▲60.0558.85 ▲5.92
Media Library /wp-admin/upload.php1,427 ▲244.23 ▲0.06102.50 ▲1.2045.79 ▲1.63

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/wp-mega/inc/class/class-wp-mega-dashboard-access.php+15
    Undefined index: HTTP_X_REQUESTED_WITH
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 14× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Mega' not found in wp-content/plugins/wp-mega/inc/class/class-wp-mega-reveal-id.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Mega' not found in wp-content/plugins/wp-mega/inc/class/class-wp-mega-remove-filter.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Mega' not found in wp-content/plugins/wp-mega/inc/class/class-wp-mega-views-counter.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Mega' not found in wp-content/plugins/wp-mega/inc/class/class-wp-mega-admin-bar.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Mega' not found in wp-content/plugins/wp-mega/inc/class/class-wp-mega-dashboard-access.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-mega/inc/class/class-wp-mega-spca.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-mega/inc/class/admin/class-codist-admin-panel.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-mega/inc/class/admin/class-wp-mega-admin-ajax.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Mega' not found in wp-content/plugins/wp-mega/inc/class/class-wp-mega-log-redirect.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Mega' not found in wp-content/plugins/wp-mega/inc/class/class-wp-mega-fb-comment.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: facebook comment, insert footer, admin bar, views counter, dashboard...

wp-mega/wp-mega.php 92% from 13 tests

This is the main PHP file of "WP Mega" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 358 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected1,162 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP14109191,162

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity7.57
▷ Minimum class complexity1.00
▷ Maximum class complexity18.00
Average method complexity2.15
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods80
▷ Static methods45.00%
▷ Public methods80100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
8 PNG files occupy 0.40MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-3.png89.83KB24.46KB▼ 72.77%
assets/icon-256x256.png18.13KB11.45KB▼ 36.86%
assets/banner-772x250.png74.38KB35.15KB▼ 52.74%
assets/plugin-logo.png10.17KB6.46KB▼ 36.52%
assets/img/plugin-logo.png10.17KB6.46KB▼ 36.52%