56% adkingpro

Code Review | Ad King Pro

WordPress plugin Ad King Pro scored56%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: 6.3.1
  • 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 /21,191 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.56MB] [CPU: ▲0.71ms] Passed 4 tests

A check of server-side resources used by Ad King Pro
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.03 ▲0.5743.10 ▲6.99
Dashboard /wp-admin3.87 ▲0.5755.77 ▲8.15
Posts /wp-admin/edit.php3.97 ▲0.6251.45 ▲2.06
Add New Post /wp-admin/post-new.php6.45 ▲0.5790.93 ▼11.07
Media Library /wp-admin/upload.php3.78 ▲0.5540.44 ▲4.85
Add New /wp-admin/post-new.php?post_type=adverts_posts3.9554.66
Advert Types /wp-admin/edit-tags.php?taxonomy=advert_types&post_type=adverts_posts3.8040.41
Settings /wp-admin/edit.php?post_type=adverts_posts&page=adkingpro3.8533.77
All Adverts /wp-admin/edit.php?post_type=adverts_posts3.8438.22

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 33 new files
Database: no new tables, 26 new options
New WordPress options
akp_auth_role
impression_expiry_time
akp_clear_on_delete
akp_image_sizes
widget_adkingpro_widget
akp_default_rev_click
akp_track_impressions
db_upgraded
akp_custom_css
widget_recent-comments
...

Browser metrics Passed 4 tests

Checking browser requirements for Ad King Pro
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,957 ▲21113.60 ▼0.847.60 ▲5.9643.14 ▲1.27
Dashboard /wp-admin2,244 ▲565.79 ▼0.11111.23 ▼4.0841.59 ▼6.91
Posts /wp-admin/edit.php2,130 ▲381.99 ▼0.0635.73 ▼5.1931.57 ▼5.91
Add New Post /wp-admin/post-new.php1,560 ▲4123.64 ▲0.16668.85 ▲0.1353.29 ▼19.98
Media Library /wp-admin/upload.php1,429 ▲444.21 ▼0.0197.58 ▼4.8144.97 ▼1.05
Add New /wp-admin/post-new.php?post_type=adverts_posts2,5604.22102.1246.52
Advert Types /wp-admin/edit-tags.php?taxonomy=advert_types&post_type=adverts_posts1,4052.1429.0034.50
Settings /wp-admin/edit.php?post_type=adverts_posts&page=adkingpro1,3751.9538.8246.38
All Adverts /wp-admin/edit.php?post_type=adverts_posts1,1392.2945.0929.03

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstaller has failed for this plugin, leaving 33 files (0.76MB) in the plugin directory
    • (new file) fonts/FontAwesome.otf
    • (new file) css/font-awesome.min.css
    • (new file) fonts/fontawesome-webfont.woff
    • (new file) fonts/fontawesome-webfont.eot
    • (new file) adkingpro.php
    • (new file) fonts/fontawesome-webfont.svg
    • (new file) css/dynamic.css.php
    • (new file) css/adkingpro-styles.css
    • (new file) fonts/fontawesome-webfont.ttf
    • (new file) css/jquery-ui.css
    • ...
  • Zombie WordPress options detected upon uninstall: 26 options
    • akp_custom_css
    • akp_ga_click_action
    • theysaidso_admin_options
    • akp_ga_imp_action
    • akp_default_window_target
    • db_upgraded
    • can_compress_scripts
    • akp_track_impressions
    • akp_default_remove_link
    • advert_types_children
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just 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+5463
    Function 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+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/adkingpro/css/dynamic.css.php
  • 8× PHP files trigger server errors when accessed directly:
    • > 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 add_shortcode() in wp-content/plugins/adkingpro/includes/output.php:392
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/adkingpro/includes/admin_area.php:28
    • > 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 register_activation_hook() in wp-content/plugins/adkingpro/adkingpro.php:33
    • > 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/js/adkingpro-js.php:70

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
    • > 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=6.3.1 1:28609 "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=6.3.1:2:26990)\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=6.3.1:2:27292)" 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=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function
  • 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=6.3.1 1:28609 "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=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=6.3.1:2:27292)" 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=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: There are too many tags (40 tag instead of maximum 10)
  • Screenshots: Please add descriptions for these screenshots #3, #4, #5 in adkingpro/assets to your readme.txt
The official readme.txt is a good inspiration

adkingpro/adkingpro.php 92% from 13 tests

"Ad King Pro" version 2.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were 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

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
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/plus_icon.png3.47KB0.82KB▼ 76.46%
images/akp-icon_32x32.png4.31KB1.59KB▼ 63.04%
images/akp-icon_16x16.png1.66KB0.87KB▼ 47.73%
images/akp-icon_32x32_sat.png2.13KB1.55KB▼ 27.02%
images/akp-icon_16x16_sat.png1.49KB0.79KB▼ 47.32%