10% popular-widget

Code Review | Popular Widget

WordPress plugin Popular Widget scored10%from 54 tests.

About plugin

  • Plugin page: popular-widget
  • Plugin version: 1.7.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-4.6.0
  • WordPress version: 6.3.1
  • First release: Feb 27, 2011
  • Latest release: Aug 22, 2016
  • Number of updates: 89
  • Update frequency: every 22.5 days
  • Top authors: Hax (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

1,000+ active /126,816 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/popular-widget/popular-widget.php+136
    Function create_function() is deprecated

Server metrics [RAM: ▼1.97MB] [CPU: ▼59.74ms] Passed 4 tests

A check of server-side resources used by Popular Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.13 ▼38.54
Dashboard /wp-admin2.05 ▼1.305.65 ▼57.07
Posts /wp-admin/edit.php2.05 ▼1.315.00 ▼45.77
Add New Post /wp-admin/post-new.php2.05 ▼3.844.92 ▼97.57
Media Library /wp-admin/upload.php2.05 ▼1.186.36 ▼33.34

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 16 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_popular-widget
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Popular Widget: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,897 ▲13613.83 ▼0.529.35 ▲7.7338.88 ▼4.91
Dashboard /wp-admin2,192 ▲155.57 ▼0.0991.72 ▲4.4340.26 ▼1.79
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0336.06 ▼5.1134.19 ▼11.73
Add New Post /wp-admin/post-new.php1,526 ▼023.41 ▼0.02661.74 ▼40.6460.67 ▲11.70
Media Library /wp-admin/upload.php1,400 ▼04.14 ▼0.08109.48 ▼4.6648.80 ▲1.66

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/popular-widget/popular-widget.php+136
    Function create_function() is deprecated
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_popular-widget
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/popular-widget/_inc/functions.php:14
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/popular-widget/_inc/widget.php:17
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/popular-widget/_inc/form.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (Screenshot Options), #2 (Sort / disable / rename), #3 (Screenshot Widget 1), #4 (Screenshot Widget 2)
  • Tags: There are too many tags (19 tag instead of maximum 10)
The official readme.txt might help

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

The main file in "Popular Widget" v. 1.7.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
70 characters long description:
Display most viewed, most commented and tags in one widget (with tabs)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected545 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP5167209520
JavaScript282023
CSS22202

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity38.50
▷ Minimum class complexity8.00
▷ Maximum class complexity69.00
Average method complexity4.57
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods21100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.10MB with 0.07MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png21.73KB6.20KB▼ 71.48%
screenshot-1.png29.28KB7.21KB▼ 75.37%
screenshot-3.png24.39KB10.68KB▼ 56.21%
screenshot-2.png29.79KB7.91KB▼ 73.45%