10% wp-adpunch-bars-lite

Code Review | WP AdPunch LITE

WordPress plugin WP AdPunch LITE scored10%from 54 tests.

About plugin

  • Plugin page: wp-adpunch-bars-lite
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.4.2
  • WordPress version: 6.3.1
  • First release: Sep 6, 2015
  • Latest release: Sep 6, 2015
  • Number of updates: 2
  • Update frequency: every 9.5 days
  • Top authors: msolution (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /714 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • The plugin cannot be installed
    • > User deprecated in wp-includes/functions.php+5643
    File upgrade-functions.php is deprecated since version 2.5.0! Use wp-admin/includes/upgrade.php instead.

Server metrics [RAM: ▼0.68MB] [CPU: ▼33.71ms] Passed 4 tests

A check of server-side resources used by WP AdPunch LITE
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.80 ▼0.677.36 ▼31.37
Dashboard /wp-admin3.50 ▲0.1928.01 ▼19.49
Posts /wp-admin/edit.php3.50 ▲0.1428.01 ▼18.25
Add New Post /wp-admin/post-new.php3.50 ▼2.3925.16 ▼65.72
Media Library /wp-admin/upload.php3.50 ▲0.2724.48 ▼9.32
Add: Bar Ad /wp-admin/admin.php?page=wpadp_addbar3.5024.71
List Ads /wp-admin/admin.php?page=wpadp_list3.5026.67
Edit CSS /wp-admin/admin.php?page=wpadp_css3.5023.89

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 66 new files
Database: 2 new tables, 7 new options
New tables
wp_wpadp_ads
wp_wpadp_meta
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
wpadp_ver
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP AdPunch LITE
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,941 ▲19513.75 ▼1.005.71 ▲3.8440.84 ▼3.33
Dashboard /wp-admin2,237 ▲494.86 ▲0.01109.06 ▼8.2139.53 ▼12.99
Posts /wp-admin/edit.php2,120 ▲311.99 ▼0.0139.94 ▲5.7035.42 ▼0.11
Add New Post /wp-admin/post-new.php6,295 ▲4,76226.06 ▲2.81921.85 ▲228.5159.13 ▲0.25
Media Library /wp-admin/upload.php1,422 ▲344.20 ▼0.02104.27 ▼6.5441.97 ▼5.62
Add: Bar Ad /wp-admin/admin.php?page=wpadp_addbar1,9396.12167.9096.28
List Ads /wp-admin/admin.php?page=wpadp_list1,2406.02156.7437.66
Edit CSS /wp-admin/admin.php?page=wpadp_css8801.9632.6024.80

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • Zombie tables detected upon uninstall: 2 tables
    • wp_wpadp_ads
    • wp_wpadp_meta
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • wpadp_ver
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 27 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpadp_css
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpadp_css
    • > User deprecated in wp-includes/functions.php+5453
    Function get_currentuserinfo is deprecated since version 4.5.0! Use wp_get_current_user() instead.
    • > GET request to /wp-admin/admin.php?page=wpadp_addbar
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/modules/wp-adpunch-bar.php+1204
    Undefined variable: result
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpadp_list
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/wp-adpunch-admin.php+611
    Undefined variable: error
  • 17 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpadp_addbar
    • > Deprecated in wp-content/plugins/wp-adpunch-bars-lite/includes/modules/wp-adpunch-bar.php+1435
    Non-static method wp_adpunch_lite::wpadp_help() should not be called statically
    • > GET request to /wp-admin/admin.php?page=wpadp_addbar
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/modules/wp-adpunch-bar.php+1238
    Undefined index: title
    • > GET request to /wp-admin/admin.php?page=wpadp_addbar
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/modules/wp-adpunch-bar.php+1243
    Undefined index: enabled
    • > GET request to /wp-admin/admin.php?page=wpadp_addbar
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/modules/wp-adpunch-bar.php+1250
    Undefined index: globalad
    • > GET request to /wp-admin/admin.php?page=wpadp_addbar
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/modules/wp-adpunch-bar.php+1255
    Undefined index: wpadp_ipp
    • > GET request to /wp-admin/admin.php?page=wpadp_addbar
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/modules/wp-adpunch-bar.php+1260
    Undefined index: wpadp_bgc
    • > GET request to /wp-admin/admin.php?page=wpadp_addbar
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/modules/wp-adpunch-bar.php+1265
    Undefined index: wpadp_bdc
    • > GET request to /wp-admin/admin.php?page=wpadp_addbar
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/modules/wp-adpunch-bar.php+1270
    Undefined index: wpadp_txtc
    • > GET request to /wp-admin/admin.php?page=wpadp_addbar
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/modules/wp-adpunch-bar.php+1296
    Undefined index: wpadp_butmessage
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpadp_addbar
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/modules/wp-adpunch-bar.php+1330
    Undefined index: wpadp_showm
    • > GET request to /wp-admin/admin.php?page=wpadp_addbar
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/modules/wp-adpunch-bar.php+1334
    Undefined index: wpadp_message
    • > GET request to /wp-admin/admin.php?page=wpadp_addbar
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/modules/wp-adpunch-bar.php+1334
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/admin.php?page=wpadp_addbar
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/modules/wp-adpunch-bar.php+1346
    Undefined index: wpadp_showt
    • > GET request to /wp-admin/admin.php?page=wpadp_addbar
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/modules/wp-adpunch-bar.php+1350
    Undefined index: wpadp_showr
    • > GET request to /wp-admin/admin.php?page=wpadp_addbar
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/modules/wp-adpunch-bar.php+1354
    Undefined index: wpadp_showp
    • > GET request to /wp-admin/admin.php?page=wpadp_addbar
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/modules/wp-adpunch-bar.php+1381
    Undefined index: wpadp_social
    • > GET request to /wp-admin/admin.php?page=wpadp_addbar
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/modules/wp-adpunch-bar.php+1399
    Undefined index: wpadp_customcss
    • > GET request to /wp-admin/admin.php?page=wpadp_addbar
    • > Deprecated in wp-content/plugins/wp-adpunch-bars-lite/includes/modules/wp-adpunch-bar.php+1414
    Non-static method wp_adpunch_admin::wpadp_admin_side() should not be called statically
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpadp_list
    • > Warning in wp-content/plugins/wp-adpunch-bars-lite/includes/wp-adpunch-admin.php+353
    Use of undefined constant wpadp_LOCAL_NAME - assumed 'wpadp_LOCAL_NAME' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/admin.php?page=wpadp_addbar
    • > Deprecated in wp-content/plugins/wp-adpunch-bars-lite/includes/wp-adpunch-admin.php+364
    Non-static method wp_adpunch_admin::wpadp_admin_side_boxs() should not be called statically
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpadp_list
    • > User deprecated in wp-includes/functions.php+5643
    File rss.php is deprecated since version 3.0.0! Use wp-includes/class-simplepie.php instead.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpadp_css
    • > Deprecated in wp-content/plugins/wp-adpunch-bars-lite/includes/wp-adpunch-admin.php+901
    Non-static method wp_adpunch_lite::wpadp_page_footer() should not be called statically
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpadp_css
    • > Deprecated in wp-content/plugins/wp-adpunch-bars-lite/includes/wp-adpunch.php+179
    Non-static method wp_adpunch_lite::wpadp_footer() should not be called statically
    • > GET request to /wp-admin/admin.php?page=wpadp_list
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/wp-adpunch-admin.php+618
    Undefined variable: result1
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpadp_list
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/wp-adpunch-admin.php+645
    Undefined variable: s
    • > GET request to /wp-admin/admin.php?page=wpadp_list
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/wp-adpunch-admin.php+645
    Undefined variable: page
    • > GET request to /wp-admin/admin.php?page=wpadp_list
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/wp-adpunch-admin.php+645
    Undefined variable: pages
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpadp_list
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/wp-adpunch-admin.php+782
    Undefined variable: pager
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpadp_list
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/wp-adpunch-admin.php+660
    Undefined index: s
    • > GET request to /wp-admin/admin.php?page=wpadp_list
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/wp-adpunch-admin.php+725
    Undefined variable: results
    • > GET request to /wp-admin/admin.php?page=wpadp_css
    • > Notice in wp-content/plugins/wp-adpunch-bars-lite/includes/wp-adpunch-admin.php+869
    Undefined variable: updated

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 fix the following items
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'wp_adpunch_head' not found in wp-content/plugins/wp-adpunch-bars-lite/includes/modules/wp-adpunch-message.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-adpunch-bars-lite/includes/wp-adpunch-admin.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-adpunch-bars-lite/includes/wp-adpunch-admin.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-adpunch-bars-lite/includes/wp-adpunch-admin.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'wp_adpunch_head' not found in wp-content/plugins/wp-adpunch-bars-lite/includes/modules/wp-adpunch-bar.php:8

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=wpadp_addbar
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&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-admin/admin.php?page=wpadp_addbar:225:30)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&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&ver=6.3.1:2:27292)" undefined
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpadp_css
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&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/admin.php?page=wpadp_list
    • > Other (severe) in unknown
    chrome-error://chromewebdata/ - Refused to display 'https://developers.google.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
    • > GET request to /wp-admin/admin.php?page=wpadp_list
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&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-admin/admin.php?page=wpadp_list:225:30)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&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&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=wpadp_css
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&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-admin/admin.php?page=wpadp_css:225:30)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&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&ver=6.3.1:2:27292)" undefined

Optimizations

Plugin configuration 87% 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
These attributes need to be fixed:
  • Donate link: Please fix this invalid url: "-"
  • Screenshots: Please add images for these screenshots: #1 (Admin - Add Campaign - General Settings;), #2 (Admin - Add Campaign - Messages;), #3 (Admin - Add Campaign - Add Social Icons to your Bar;), #4 (Admin - Add Campaign - List all campaigns;)
Please take inspiration from this readme.txt

wp-adpunch-bars-lite/wp-adpunch-lite.php 85% from 13 tests

The primary PHP file in "WP AdPunch LITE" version 1.0.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 326 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-adpunch-bars-lite.php" instead of "wp-adpunch-lite.php")

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
No dangerous file extensions were detected3,197 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP63962492,391
JavaScript113336766
CSS25131
HTML1309

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity68.40
▷ Minimum class complexity5.00
▷ Maximum class complexity151.00
Average method complexity7.24
▷ Minimum method complexity1.00
▷ Maximum method complexity88.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods54
▷ Static methods00.00%
▷ Public methods54100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants26
▷ Global constants26100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
38 PNG files occupy 0.07MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/social/flickr.png0.67KB0.66KB▼ 1.59%
img/share.png0.83KB0.76KB▼ 9.01%
img/social/github.png1.60KB0.95KB▼ 40.28%
img/social/in.png1.51KB0.73KB▼ 51.81%
img/arrow/arr5.png3.80KB1.44KB▼ 62.16%