78% adthrive-ads

Code Review | AdThrive Ads

WordPress plugin AdThrive Ads scored 78% from 54 tests.

About plugin

  • Plugin page: adthrive-ads
  • Plugin version: 1.1.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6.0-5.9
  • WordPress version: 5.9.2
  • First release: Mar 21, 2016
  • Latest release: Jan 27, 2022
  • Number of updates: 77
  • Update frequency: every 27.9 days
  • Top authors: adthrive (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

4,000+ active / 93,026 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼2.12MB] [CPU: ▼378.39ms] Passed 4 tests

This is a short check of server-side resources used by AdThrive Ads
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.21 ▼1.317.10 ▼43.89
Dashboard /wp-admin2.28 ▼1.138.33 ▼25.11
Posts /wp-admin/edit.php2.29 ▼1.367.71 ▼29.85
Add New Post /wp-admin/post-new.php2.28 ▼4.698.14 ▼1,414.72
Media Library /wp-admin/upload.php2.29 ▼1.017.03 ▼17.09

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for AdThrive Ads
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,828 ▲7416.01 ▼0.0610.46 ▲4.753.32 ▲0.48
Dashboard /wp-admin2,916 ▲626.18 ▲0.03123.82 ▼6.16157.96 ▲1.05
Posts /wp-admin/edit.php2,719 ▲253.27 ▲0.0364.90 ▲0.26137.35 ▼7.18
Add New Post /wp-admin/post-new.php1,899 ▲23817.86 ▼4.89404.30 ▼52.92189.72 ▲32.47
Media Library /wp-admin/upload.php1,723 ▲255.58 ▲0.06141.51 ▼1.86187.66 ▲0.86

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Warning in wp-admin/includes/class-wp-filesystem-direct.php+39
    file_get_contents(wp-content/plugins/adthrive-ads/site.js): failed to open stream: No such file or directory

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/adthrive-ads/components/ads/partials/insertion-includes.php
  • 47× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/adthrive-ads/cmb2/includes/types/CMB2_Type_Radio.php:13
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/adthrive-ads/components/ads/partials/insertion-includes.php on line 20
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Radio' not found in wp-content/plugins/adthrive-ads/cmb2/includes/types/CMB2_Type_Multicheck.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/adthrive-ads/cmb2/includes/helper-functions.php:131
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/adthrive-ads/components/ads/partials/insertion-includes.php on line 20
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/adthrive-ads/cmb2/includes/types/CMB2_Type_Taxonomy_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/adthrive-ads/cmb2/includes/types/CMB2_Type_Taxonomy_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/adthrive-ads/cmb2/includes/rest-api/CMB2_REST.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function AdThrive_Ads\\add_action() in wp-content/plugins/adthrive-ads/class-main.php:21
    • > PHP Notice
      Undefined variable: body_classes in wp-content/plugins/adthrive-ads/components/ads/partials/insertion-includes.php on line 35

User-side errors Passed 1 test

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


Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Screenshots: Please add descriptions for these screenshots #1, #2 in adthrive-ads/assets to your readme.txt
You can take inspiration from this readme.txt

adthrive-ads/adthrive-ads.php Passed 13 tests

The main PHP script in "AdThrive Ads" version 1.1.4 is automatically included on every request by WordPress
12 characters long description:
AdThrive Ads

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected48,957 lines of code in 259 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity18.29
▷ Minimum class complexity1.00
▷ Maximum class complexity186.00
Average method complexity3.23
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
▷ Abstract classes910.84%
▷ Concrete classes7489.16%
▷ Final classes00.00%
▷ Static methods9114.31%
▷ Public methods52282.08%
▷ Protected methods8913.99%
▷ Private methods253.93%
▷ Named functions3792.50%
▷ Anonymous functions37.50%
▷ Global constants857.14%
▷ Class constants642.86%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
19 PNG files occupy 0.13MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
cmb2/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
cmb2/images/ui-icons_888888_256x240.png5.23KB4.11KB▼ 21.49%
assets/screenshot-2.png8.79KB4.70KB▼ 46.49%
cmb2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%