10% my-popular-posts-widget

Code Review | My Popular Posts Widget

WordPress plugin My Popular Posts Widget scored10%from 54 tests.

About plugin

  • Plugin page: my-popular-posts-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.8.1
  • WordPress version: 6.3.1
  • First release: Mar 4, 2014
  • Latest release: Mar 5, 2014
  • Number of updates: 11
  • Update frequency: every 0.1 days
  • Top authors: gbobbd (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /5,302 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
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/my-popular-posts-widget/my-popular-posts-widget.php+10
    Methods with the same name as their class will not be constructors in a future version of PHP; My_Popular_Posts has a deprecated constructor

Server metrics [RAM: ▼1.71MB] [CPU: ▼47.46ms] Passed 4 tests

Server-side resources used by My Popular Posts Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.28 ▼1.188.88 ▼32.06
Dashboard /wp-admin2.29 ▼1.0110.59 ▼39.03
Posts /wp-admin/edit.php2.29 ▼1.0611.36 ▼34.72
Add New Post /wp-admin/post-new.php2.29 ▼3.5910.74 ▼84.02
Media Library /wp-admin/upload.php2.29 ▼0.9411.11 ▼22.21

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_my_popula_posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for My Popular Posts Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.30 ▼1.451.70 ▼0.0841.75 ▼3.39
Dashboard /wp-admin2,203 ▲155.82 ▲0.93105.48 ▼1.7438.12 ▼4.46
Posts /wp-admin/edit.php2,092 ▲32.00 ▼0.0138.96 ▲4.3334.63 ▲1.03
Add New Post /wp-admin/post-new.php1,532 ▼118.57 ▼4.61602.71 ▼25.2559.33 ▲9.21
Media Library /wp-admin/upload.php1,391 ▲34.22 ▲0.00102.06 ▲1.8643.53 ▼0.11

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in My_Popular_Posts is deprecated since version 4.3.0! Use __construct() instead.
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_my_popula_posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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 fix the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/my-popular-posts-widget/my-popular-posts-widget.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: popular, popular-posts, thumbnail, post, widget

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

"My Popular Posts Widget" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
95 characters long description:
A very simple popular posts widget which displays posts by comment count (with featured image).

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
No dangerous file extensions were detected116 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11814116

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity4.33
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.03MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png26.19KB24.96KB▼ 4.69%