74% bannerlid

Code Review | Bannerlid

WordPress plugin Bannerlid scored74%from 54 tests.

About plugin

  • Plugin page: bannerlid
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.3
  • WordPress version: 6.3.1
  • First release: Mar 31, 2015
  • Latest release: Apr 24, 2015
  • Number of updates: 23
  • Update frequency: every 1.0 days
  • Top authors: web_lid (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,306 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.38MB] [CPU: ▼1.24ms] Passed 4 tests

This is a short check of server-side resources used by Bannerlid
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.86 ▲0.4040.63 ▼12.43
Dashboard /wp-admin3.74 ▲0.4353.42 ▲5.04
Posts /wp-admin/edit.php3.79 ▲0.4357.09 ▲8.94
Add New Post /wp-admin/post-new.php6.23 ▲0.3498.69 ▼3.99
Media Library /wp-admin/upload.php3.57 ▲0.3441.47 ▲6.43
Banners /wp-admin/admin.php?page=bannerlid3.6239.75
Zones /wp-admin/admin.php?page=bannerlid-zones3.6140.72
Stats /wp-admin/admin.php?page=bannerlid-stats3.5944.64

Server storage [IO: ▲0.54MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 77 new files
Database: 5 new tables, 8 new options
New tables
wp_bannerlid_banner_post_relations
wp_bannerlid_relations
wp_bannerlid_zones
wp_bannerlid_banners
wp_bannerlid_stats
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
bannerlid-enable-flash
db_upgraded
widget_recent-comments
bannerlid-collect-stats

Browser metrics Passed 4 tests

Bannerlid: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,032 ▲26115.86 ▲1.561.68 ▼0.5339.98 ▼3.70
Dashboard /wp-admin2,416 ▲2286.75 ▲0.86145.06 ▲26.2043.42 ▲0.30
Posts /wp-admin/edit.php2,328 ▲2394.02 ▲2.0263.05 ▲28.8134.58 ▼1.84
Add New Post /wp-admin/post-new.php1,567 ▲5323.75 ▲6.12647.68 ▼68.1836.61 ▼17.98
Media Library /wp-admin/upload.php1,458 ▲735.37 ▲1.17101.75 ▼7.5051.54 ▲5.82
Banners /wp-admin/admin.php?page=bannerlid1,1523.8048.4025.43
Zones /wp-admin/admin.php?page=bannerlid-zones1,1483.7946.2224.93
Stats /wp-admin/admin.php?page=bannerlid-stats1,0333.9049.6922.59

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie tables detected upon uninstall: 5 tables
    • wp_bannerlid_relations
    • wp_bannerlid_zones
    • wp_bannerlid_banner_post_relations
    • wp_bannerlid_stats
    • wp_bannerlid_banners
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 33× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/bannerlid/views/AdminZonesCountries.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_admin_url() in wp-content/plugins/bannerlid/views/FormFilter.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/bannerlid/views/AdminBannersEdit.php:17
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/bannerlid/views/AdminZonesUsers.php:4
    • > PHP Notice
      Undefined variable: action in wp-content/plugins/bannerlid/views/AdminZones.php on line 24
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/bannerlid/views/AdminBannersOverview.php:4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/bannerlid/classes/ZonesTable.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/bannerlid/views/AdminStats.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/bannerlid/views/AdminZones.php:80
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/bannerlid/views/AdminZonesDefault.php:3

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

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
Please fix the following attributes:
  • Plugin Name: You should set the name of your plugin on the first line ( === bannerlid === )
The official readme.txt is a good inspiration

bannerlid/bannerlid.php Passed 13 tests

The main PHP file in "Bannerlid" ver. 1.1.0 adds more information about the plugin and also serves as the entry point for this plugin
68 characters long description:
Simple banner/advert management system with stats and flash support.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin11,143 lines of code in 71 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript141,2951,1277,174
PHP336961,5112,262
Markdown113660980
HTML8700552
CSS2221126
JSON20039
YAML13010

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity8.06
▷ Minimum class complexity1.00
▷ Maximum class complexity38.00
Average method complexity2.04
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes18
▷ Abstract classes15.56%
▷ Concrete classes1794.44%
▷ Final classes00.00%
Methods120
▷ Static methods75.83%
▷ Public methods11192.50%
▷ Protected methods10.83%
▷ Private methods86.67%
Functions9
▷ Named functions666.67%
▷ Anonymous functions333.33%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/swf_icon.png0.68KB0.58KB▼ 13.56%