10% bw-posts-top

Code Review | BW Posts Top

WordPress plugin BW Posts Top scored10%from 54 tests.

About plugin

  • Plugin page: bw-posts-top
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.8.1
  • WordPress version: 6.3.1
  • First release: Mar 18, 2014
  • Latest release: Mar 18, 2014
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: brainymore (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,726 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/bw-posts-top/bw-posts-top-widget.php+42
    Methods with the same name as their class will not be constructors in a future version of PHP; bw_post_top_Widget has a deprecated constructor

Server metrics [RAM: ▼1.72MB] [CPU: ▼54.64ms] Passed 4 tests

This is a short check of server-side resources used by BW Posts Top
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.28 ▼1.188.85 ▼31.85
Dashboard /wp-admin2.29 ▼1.0511.33 ▼53.99
Posts /wp-admin/edit.php2.29 ▼1.069.90 ▼43.72
Add New Post /wp-admin/post-new.php2.29 ▼3.5910.42 ▼88.98
Media Library /wp-admin/upload.php2.29 ▼0.9410.52 ▼28.68

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_bw-posts-top-widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for BW Posts Top
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲3014.37 ▲0.021.63 ▼0.2438.40 ▼6.34
Dashboard /wp-admin2,195 ▲185.57 ▼0.0788.21 ▲0.2739.88 ▼4.57
Posts /wp-admin/edit.php2,100 ▲181.98 ▼0.0438.83 ▲1.9334.52 ▼2.52
Add New Post /wp-admin/post-new.php1,526 ▼023.14 ▼0.21652.79 ▼28.0650.00 ▼8.70
Media Library /wp-admin/upload.php1,403 ▲64.26 ▼0.03101.33 ▼3.5343.11 ▼0.64

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin cannot be uninstalled
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in bw_post_top_Widget is deprecated since version 4.3.0! Use __construct() instead.
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_bw-posts-top-widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% 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)
Good news, no errors were detected

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
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/bw-posts-top/themes/default.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bw-posts-top/bw-posts-top-widget.php:13

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 errors were detected

Optimizations

Plugin configuration 93% 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
These attributes need your attention:
  • Tags: There are too many tags (29 tag instead of maximum 10)
Please take inspiration from this readme.txt

bw-posts-top/bw-posts-top-widget.php 92% from 13 tests

The entry point to "BW Posts Top" version 1.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("bw-posts-top.php" instead of "bw-posts-top-widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin1,453 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP25954555
CSS3108484
SVG100414

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity87.00
▷ Minimum class complexity87.00
▷ Maximum class complexity87.00
Average method complexity15.33
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods583.33%
▷ Protected methods116.67%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
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
There were not PNG files found in your plugin