94% mega-ad

Code Review | Mega Ad

WordPress plugin Mega Ad scored 94% from 53 tests.

About plugin

  • Plugin page: mega-ad
  • Plugin version: 1.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.0.2
  • WordPress version: 5.8.1
  • First release: Feb 28, 2015
  • Latest release: Dec 27, 2018
  • Number of updates: 19
  • Update frequency: every 73.6 days
  • Top authors: Surfstang (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 1,303 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.70MB] [CPU: ▼336.43ms] Passed 4 tests

This is a short check of server-side resources used by Mega Ad
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.7736.83 ▲15.96
Dashboard /wp-admin3.77 ▲0.7246.41 ▲11.39
Posts /wp-admin/edit.php3.80 ▲0.6947.24 ▲6.08
Add New Post /wp-admin/post-new.php6.13 ▲0.7094.88 ▼1,358.62
Media Library /wp-admin/upload.php3.71 ▲0.7136.32 ▼4.57
Mega Ads /wp-admin/edit.php?post_type=mega-ad3.7633.55
Add New /wp-admin/post-new.php?post_type=mega-ad4.1252.45

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 203 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Mega Ad: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,725 ▲11915.90 ▲0.417.84 ▼1.4946.43 ▼3.06
Dashboard /wp-admin2,997 ▲1476.23 ▲0.46143.22 ▼11.45102.22 ▼3.07
Posts /wp-admin/edit.php2,754 ▲512.71 ▲0.0365.73 ▲2.7188.13 ▼1.14
Add New Post /wp-admin/post-new.php1,683 ▲3018.86 ▲0.12375.73 ▲10.15111.75 ▲4.53
Media Library /wp-admin/upload.php1,823 ▲515.07 ▲0.06157.63 ▼19.50110.32 ▼9.66
Mega Ads /wp-admin/edit.php?post_type=mega-ad1,4112.6564.0367.40
Add New /wp-admin/post-new.php?post_type=mega-ad2,3324.59118.1687.65

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 41× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/mega-ad/inc/cmb2/includes/types/CMB2_Type_Taxonomy_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/mega-ad/inc/cmb2/includes/CMB2_Field.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/mega-ad/inc/cmb2/includes/rest-api/CMB2_REST.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/mega-ad/inc/cmb2/includes/types/CMB2_Type_Textarea.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mega-ad/inc/cmb2/example-functions.php:105
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/mega-ad/inc/cmb2/includes/types/CMB2_Type_Textarea_Code.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/mega-ad/inc/cmb2/includes/types/CMB2_Type_Wysiwyg.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/mega-ad/inc/cmb2/includes/types/CMB2_Type_Text.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/mega-ad/inc/cmb2/includes/types/CMB2_Type_File_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/mega-ad/inc/cmb2/includes/types/CMB2_Type_Text_Date.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Plugin Name: Please specify the plugin name on the first line ( === mega-ad === )
The official readme.txt is a good inspiration

mega-ad/mega-ad-plugin.php 92% from 13 tests

The entry point to "Mega Ad" version 1.1.4 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("mega-ad.php" instead of "mega-ad-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected37,462 lines of code in 164 files:
LanguageFilesBlank linesComment linesLines of code
PO File9411,21814,50625,272
PHP572,0856,0566,993
SVG1032,227
CSS45223081,321
JavaScript62802691,039
Markdown22070610

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity18.48
▷ Minimum class complexity1.00
▷ Maximum class complexity181.00
Average method complexity3.24
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes66
▷ Abstract classes812.12%
▷ Concrete classes5887.88%
▷ Final classes00.00%
Methods518
▷ Static methods8616.60%
▷ Public methods42782.43%
▷ Protected methods8816.99%
▷ Private methods30.58%
Functions38
▷ Named functions38100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants440.00%
▷ Class constants660.00%
▷ Public constants6100.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Using a strong compression for your PNG files is a great way to speed-up your plugin
18 compressed PNG files occupy 0.93MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/cmb2/images/ui-icons_888888_256x240.png5.23KB4.11KB▼ 21.49%
assets/images/close-message.png0.82KB0.80KB▼ 2.73%
assets/images/screenshot-1.png0.00KB0.00KB0.00%
inc/cmb2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
inc/cmb2/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%