10% popularity-posts-widget

Code Review | Popularity Posts Widget

WordPress plugin Popularity Posts Widget scored10%from 54 tests.

About plugin

  • Plugin page: popularity-posts-...
  • Plugin version: 1.13
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-3.5.1
  • WordPress version: 6.3.1
  • First release: Jan 27, 2013
  • Latest release: Mar 24, 2013
  • Number of updates: 89
  • Update frequency: every 6.4 days
  • Top authors: Mihail Barinov (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

700+ active /40,703 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
These installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/popularity-posts-widget/class_popularity-posts-widget.php+333
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

Server metrics [RAM: ▼1.80MB] [CPU: ▼55.82ms] Passed 4 tests

Analyzing server-side resources used by Popularity Posts Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.19 ▼1.275.58 ▼38.81
Dashboard /wp-admin2.21 ▼1.096.55 ▼44.22
Posts /wp-admin/edit.php2.21 ▼1.146.56 ▼41.52
Add New Post /wp-admin/post-new.php2.21 ▼3.687.83 ▼98.73
Media Library /wp-admin/upload.php2.21 ▼1.025.77 ▼30.70

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 15 new files
Database: 2 new tables, 7 new options
New tables
wp_PopularityPostsWidget
wp_PopularityPostsWidgetCache
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_popularitypostswidget
widget_theysaidso_widget

Browser metrics Passed 4 tests

Popularity Posts Widget: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.33 ▼0.201.73 ▲0.0546.32 ▲9.10
Dashboard /wp-admin2,198 ▲215.53 ▼0.1692.44 ▲2.8141.94 ▲4.00
Posts /wp-admin/edit.php2,100 ▼02.00 ▲0.0136.55 ▲0.8435.75 ▲0.87
Add New Post /wp-admin/post-new.php1,526 ▼223.60 ▲0.52643.63 ▼49.0745.38 ▼19.95
Media Library /wp-admin/upload.php1,394 ▼94.17 ▼0.0399.54 ▼19.6244.27 ▼5.48

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/popularity-posts-widget/class_popularity-posts-widget.php+333
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_popularitypostswidget
    • theysaidso_admin_options
    • widget_recent-comments

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)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/popularity-posts-widget/kama_thumbnail.php:333
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/popularity-posts-widget/class_popularity-posts-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/popularity-posts-widget/style/style-one.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/popularity-posts-widget/class_popularity-posts-widget.php:3

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 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
Attributes that require attention:
  • Tags: You are using too many tags: 28 tag instead of maximum 10
Please take inspiration from this readme.txt

popularity-posts-widget/popularity-posts-widget.php Passed 13 tests

"Popularity Posts Widget" version 1.13's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
67 characters long description:
Allows you to show your most viewed posts as a widget on your blog.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin704 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP6193135635
PO File1171751
CSS112818

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity35.00
▷ Minimum class complexity11.00
▷ Maximum class complexity85.00
Average method complexity7.48
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods1885.71%
▷ Protected methods00.00%
▷ Private methods314.29%
Functions17
▷ Named functions17100.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
nothumb.png5.75KB4.78KB▼ 16.92%