83% optimate-ads

Code Review | Optimate Ads - Advance Ad Inserter AdSense & Ad Manager

WordPress plugin Optimate Ads - Advance Ad Inserter AdSense & Ad Manager scored83%from 54 tests.

About plugin

  • Plugin page: optimate-ads
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.3
  • WordPress version: 6.3.1
  • First release: Oct 28, 2022
  • Latest release: Aug 21, 2023
  • Number of updates: 46
  • Update frequency: every 6.5 days
  • Top authors: shujahat21 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,643 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.41MB] [CPU: ▲0.10ms] Passed 4 tests

Server-side resources used by Optimate Ads - Advance Ad Inserter AdSense & Ad Manager
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.85 ▲0.3940.84 ▼0.17
Dashboard /wp-admin3.72 ▲0.4249.29 ▼2.71
Posts /wp-admin/edit.php3.77 ▲0.4155.03 ▲5.31
Add New Post /wp-admin/post-new.php6.32 ▲0.4389.45 ▼2.04
Media Library /wp-admin/upload.php3.64 ▲0.4141.76 ▲7.55

Server storage [IO: ▲0.38MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_ssag_optimate_ad_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Optimate Ads - Advance Ad Inserter AdSense & Ad Manager
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,937 ▲19113.78 ▼0.496.09 ▲4.2139.93 ▼5.74
Dashboard /wp-admin2,235 ▲445.12 ▲0.09114.43 ▲7.2642.37 ▼1.54
Posts /wp-admin/edit.php2,121 ▲322.31 ▲0.2737.94 ▼3.7032.84 ▼2.78
Add New Post /wp-admin/post-new.php1,542 ▲923.08 ▼0.06636.53 ▼62.2351.47 ▼5.84
Media Library /wp-admin/upload.php1,420 ▲324.34 ▲0.1998.77 ▼3.2041.95 ▼7.44

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_ssag_optimate_ad_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/optimate-ads/widgets/class-optimate-ad-widget.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% 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
6 plugin tags: google adsense ads, adsense ads, ad inserter, adstxt, ads placement...

optimate-ads/class-opa-main-class.php 85% from 13 tests

The principal PHP file in "Optimate Ads - Advance Ad Inserter AdSense & Ad Manager" v. 1.0.3 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("optimate-ads.php" instead of "class-opa-main-class.php")
  • Domain Path: The domain path folder was not found ("/languages")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin8,427 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript31,0952864,953
PHP43002612,525
CSS34417949

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 168)
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity133.00
▷ Minimum class complexity6.00
▷ Maximum class complexity439.00
Average method complexity12.73
▷ Minimum method complexity1.00
▷ Maximum method complexity168.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods45
▷ Static methods00.00%
▷ Public methods45100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
media/images/icon.png6.94KB3.89KB▼ 43.96%