56% adkingpro

Code Review | Ad King Pro

WordPress plugin Ad King Pro scored 56% from 54 tests.

About plugin

  • Plugin page: adkingpro
  • Plugin version: 2.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.4.2
  • WordPress version: 5.9.2
  • First release: May 7, 2013
  • Latest release: Apr 6, 2016
  • Number of updates: 52
  • Update frequency: every 20.5 days
  • Top authors: ashdurham (100%)

Code review

54 tests

User reviews

19 reviews

Install metrics

200+ active / 20,622 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.52MB] [CPU: ▼293.61ms] Passed 4 tests

Analyzing server-side resources used by Ad King Pro
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.11 ▲0.5962.23 ▲8.68
Dashboard /wp-admin3.97 ▲0.5638.33 ▲4.10
Posts /wp-admin/edit.php4.18 ▲0.5442.62 ▲4.42
Add New Post /wp-admin/post-new.php7.43 ▲0.4699.55 ▼1,182.27
Media Library /wp-admin/upload.php3.84 ▲0.5429.26 ▼0.67
Settings /wp-admin/edit.php?post_type=adverts_posts&page=adkingpro3.9327.01
Add New /wp-admin/post-new.php?post_type=adverts_posts4.1653.27
All Adverts /wp-admin/edit.php?post_type=adverts_posts3.9529.73
Advert Types /wp-admin/edit-tags.php?taxonomy=advert_types&post_type=adverts_posts3.9133.40

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 33 new files
Database: no new tables, 20 new options
New WordPress options
akp_default_rev_imp
expiry_time
akp_image_sizes
akp_ga_implemented
advert_types_children
akp_default_rev_click
akp_track_impressions
akp_ga_imp_action
widget_adkingpro_widget
akp_custom_css
...

Browser metrics Passed 4 tests

Ad King Pro: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,964 ▲21016.20 ▲0.199.40 ▲3.703.40 ▲1.19
Dashboard /wp-admin2,936 ▲856.13 ▼0.15121.75 ▼19.75155.31 ▼5.00
Posts /wp-admin/edit.php2,737 ▲463.23 ▼0.0161.96 ▼2.98143.78 ▲7.68
Add New Post /wp-admin/post-new.php1,693 ▲2416.57 ▼4.89409.81 ▼47.96154.69 ▼7.39
Media Library /wp-admin/upload.php1,743 ▲455.52 ▲0.04143.27 ▼1.20187.78 ▼4.27
Settings /wp-admin/edit.php?post_type=adverts_posts&page=adkingpro1,8582.8368.52187.36
Add New /wp-admin/post-new.php?post_type=adverts_posts3,3646.06130.74160.64
All Adverts /wp-admin/edit.php?post_type=adverts_posts1,4983.2471.91117.88
Advert Types /wp-admin/edit-tags.php?taxonomy=advert_types&post_type=adverts_posts1,8022.7859.00145.47

Uninstaller [IO: ▲0.76MB] [DB: ▲0.00MB] 50% 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
  • The plugin did not uninstall successfully, leaving 33 files (0.76MB) in the plugin directory
    • (new file) fonts/FontAwesome.otf
    • (new file) fonts/fontawesome-webfont.ttf
    • (new file) fonts/fontawesome-webfont.eot
    • (new file) fonts/fontawesome-webfont.svg
    • (new file) css/jquery-ui.css
    • (new file) adkingpro.php
    • (new file) css/adkingpro-styles.css
    • (new file) fonts/fontawesome-webfont.woff
    • (new file) css/dynamic.css.php
    • (new file) css/font-awesome.min.css
    • ...
  • This plugin does not fully uninstall, leaving 20 options in the database
    • akp_image_sizes
    • akp_clear_on_delete
    • akp_custom_css
    • akp_auth_role
    • akp_default_window_target
    • akp_ga_intergrated
    • impression_expiry_time
    • akp_ga_click_action
    • akp_default_rev_imp
    • widget_adkingpro_widget
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/edit.php?post_type=adverts_posts&page=adkingpro
    • > User deprecated in wp-includes/functions.php+5326
    screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/edit.php?post_type=adverts_posts&page=adkingpro
    • > User deprecated in wp-includes/functions.php+5326
    get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/adkingpro/css/dynamic.css.php
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Notice
      Undefined variable: akp_css in wp-content/plugins/adkingpro/css/dynamic.css.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/adkingpro/includes/admin_area.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/adkingpro/includes/screens/settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/adkingpro/adkingpro.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/adkingpro/js/adkingpro-js.php:70
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/adkingpro/includes/widget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/adkingpro/includes/admin_area.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/adkingpro/includes/output.php:392

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=adverts_posts
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=5.9.2 1:31592 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/adkingpro/js/adkingpro-admin-functions.js?ver=1.0.0:449:51)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=5.9.2:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=5.9.2:2:30340)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=adverts_posts
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=5.9.2 1:31702 Uncaught TypeError: $(...).live is not a function
    • > GET request to /wp-admin/post-new.php?post_type=adverts_posts
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,moxiejs,plupload&ver=5.9.2 1:31592 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/adkingpro/js/adkingpro-admin-functions.js?ver=1.0.0:449:51)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,moxiejs,plupload&ver=5.9.2:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,moxiejs,plupload&ver=5.9.2:2:30340)" undefined
    • > GET request to /wp-admin/post-new.php?post_type=adverts_posts
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,moxiejs,plupload&ver=5.9.2 1:31702 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 40 tag instead of maximum 10
  • Screenshots: No descriptions were found for these screenshots #3, #4, #5 in adkingpro/assets to your readme.txt
Please take inspiration from this readme.txt

adkingpro/adkingpro.php 92% from 13 tests

The principal PHP file in "Ad King Pro" v. 2.0.1 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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 detected4,926 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP8264972,044
PO File24315051,093
CSS37252927
JavaScript37057463
SVG100399

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity63.67
▷ Minimum class complexity6.00
▷ Maximum class complexity147.00
Average method complexity4.48
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods54
▷ Static methods00.00%
▷ Public methods54100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/akp-icon_16x16_sat.png1.49KB0.79KB▼ 47.32%
images/minus_icon.png3.44KB0.81KB▼ 76.43%
images/plus_icon.png3.47KB0.82KB▼ 76.46%
images/akp-icon_32x32_sat.png2.13KB1.55KB▼ 27.02%
images/akp-icon_16x16.png1.66KB0.87KB▼ 47.73%