94% ad-publisher

Code Review | AD Publisher - Automatically insert post ads

WordPress plugin AD Publisher - Automatically insert post ads scored 94% from 54 tests.

About plugin

  • Plugin page: ad-publisher
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.0
  • WordPress version: 5.9.2
  • First release: Jan 30, 2019
  • Latest release: Apr 30, 2019
  • Number of updates: 21
  • Update frequency: every 4.3 days
  • Top authors: adsstudio (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

300+ active / 3,413 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼293.05ms] Passed 4 tests

Server-side resources used by AD Publisher - Automatically insert post ads
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.1556.33 ▲8.07
Dashboard /wp-admin3.51 ▲0.1032.08 ▼2.82
Posts /wp-admin/edit.php3.73 ▲0.0935.51 ▲0.11
Add New Post /wp-admin/post-new.php6.97 ▼0.0093.31 ▼1,171.18
Media Library /wp-admin/upload.php3.39 ▲0.1025.97 ▲1.68
Settings /wp-admin/edit.php?post_type=adpublisher3.4925.21
Add New Ad /wp-admin/post-new.php?post_type=adpublisher3.7236.59
Modules /wp-admin/edit.php?post_type=adpublisher&page=adp_modules3.4222.60

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 28 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

AD Publisher - Automatically insert post ads: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,809 ▲5516.14 ▲0.516.14 ▲0.432.11 ▼1.00
Dashboard /wp-admin2,938 ▲776.21 ▲0.04113.41 ▼21.20171.03 ▲10.16
Posts /wp-admin/edit.php2,730 ▲393.24 ▼0.1162.58 ▼2.13141.02 ▼0.93
Add New Post /wp-admin/post-new.php1,829 ▲16822.73 ▲6.35451.39 ▲31.40194.03 ▲32.16
Media Library /wp-admin/upload.php1,744 ▲465.59 ▲0.07122.50 ▼12.75202.48 ▲17.05
Settings /wp-admin/edit.php?post_type=adpublisher1,5423.3160.29197.20
Add New Ad /wp-admin/post-new.php?post_type=adpublisher2,2524.0677.85177.00
Modules /wp-admin/edit.php?post_type=adpublisher&page=adp_modules1,3542.4456.83183.43

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstall script ran successfully

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 | 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 take a closer look at the following
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_current_screen() in wp-content/plugins/ad-publisher/includes/views/settings.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Upgrader_Skin' not found in wp-content/plugins/ad-publisher/includes/classes/class-upgrader-skin.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_current_screen() in wp-content/plugins/ad-publisher/includes/views/head.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/ad-publisher/includes/views/adp-post-metabox.php:5
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/ad-publisher/includes/views/adp-post-metabox.php on line 4
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/ad-publisher/includes/views/adp-post-metabox.php on line 4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/ad-publisher/includes/views/modules.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
8 plugin tags: ads plugin, adsense injection, ad manager, ads pro, ads...

ad-publisher/ad-publisher.php Passed 13 tests

The main PHP file in "AD Publisher - Automatically insert post ads" ver. 1.1.0 adds more information about the plugin and also serves as the entry point for this plugin
45 characters long description:
Plugin for automatic insertion of the ad code

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
Everything looks great! No dangerous files found in this plugin2,319 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP123238331,356
CSS210322562
PO File2121130343
JavaScript17158

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity28.86
▷ Minimum class complexity1.00
▷ Maximum class complexity134.00
Average method complexity3.79
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes114.29%
Methods70
▷ Static methods1014.29%
▷ Public methods6390.00%
▷ Protected methods57.14%
▷ Private methods22.86%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants218.18%
▷ Class constants981.82%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon.png18.55KB0.71KB▼ 96.18%
assets/images/module-4.png23.24KB4.23KB▼ 81.81%
assets/images/module-1.png10.47KB4.68KB▼ 55.29%
assets/images/module-2.png2.04KB1.71KB▼ 16.29%
assets/images/module-3.png1.80KB2.01KB0.00%