78% new-popular-posts-widget

Code Review | New Popular Posts Widget

WordPress plugin New Popular Posts Widget scored78%from 54 tests.

About plugin

  • Plugin page: new-popular-posts...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7
  • WordPress version: 6.3.1
  • First release: Dec 13, 2016
  • Latest release: Dec 13, 2016
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: rashadul91 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

40+ active /2,807 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼4.34ms] Passed 4 tests

Analyzing server-side resources used by New Popular Posts Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0738.56 ▲0.35
Dashboard /wp-admin3.36 ▲0.0643.88 ▼4.41
Posts /wp-admin/edit.php3.48 ▲0.1248.38 ▲4.63
Add New Post /wp-admin/post-new.php5.94 ▲0.0680.25 ▼16.60
Media Library /wp-admin/upload.php3.28 ▲0.0636.11 ▲3.29

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

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

Browser metrics Passed 4 tests

Checking browser requirements for New Popular Posts Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,872 ▲11113.79 ▼0.568.21 ▲6.5837.21 ▼4.19
Dashboard /wp-admin2,195 ▲155.48 ▼0.1184.97 ▼6.0336.41 ▼5.60
Posts /wp-admin/edit.php2,100 ▲181.97 ▼0.0133.80 ▼2.0533.27 ▼6.16
Add New Post /wp-admin/post-new.php1,527 ▲123.05 ▲0.04601.20 ▼30.6960.11 ▲1.85
Media Library /wp-admin/upload.php1,400 ▲64.20 ▼0.09100.00 ▲0.5241.99 ▼2.80

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_npp-popular_posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/new-popular-posts-widget/public/partials/new-popular-posts-widget-public-display.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/new-popular-posts-widget/includes/class-new-popular-posts-widgets-functions.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
You can take inspiration from this readme.txt

new-popular-posts-widget/new-popular-posts-widget.php Passed 13 tests

The main PHP file in "New Popular Posts Widget" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
96 characters long description:
This is a short description of what the plugin does. It's displayed in the WordPress admin area.

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
Everything looks great! No dangerous files found in this plugin340 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP10129417218
CSS1132770
JSON10034
SVG13015
JavaScript12273

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity3.50
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity1.62
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods24
▷ Static methods28.33%
▷ Public methods2083.33%
▷ Protected methods00.00%
▷ Private methods416.67%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.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
PNG images were not found in this plugin