68% wordpress-popular-posts

Code Review | WordPress Popular Posts

WordPress plugin WordPress Popular Posts scored68%from 54 tests.

About plugin

  • Plugin page: wordpress-popular...
  • Plugin version: 6.3.4
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.4.1
  • WordPress version: 6.3.1
  • First release: Nov 20, 2008
  • Latest release: Nov 9, 2023
  • Number of updates: 245
  • Update frequency: every 22.3 days
  • Top authors: hcabrera (73.88%)Ikki24 (26.53%)

Code review

54 tests

User reviews

239 reviews

Install metrics

200,000+ active /7,142,935 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.32MB] [CPU: ▲8.48ms] Passed 4 tests

Server-side resources used by WordPress Popular Posts
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.79 ▲1.3345.19 ▲7.15
Dashboard /wp-admin4.73 ▲1.4360.71 ▲9.94
Posts /wp-admin/edit.php4.71 ▲1.3661.83 ▲16.91
Add New Post /wp-admin/post-new.php7.21 ▲1.3299.79 ▲5.50
Media Library /wp-admin/upload.php4.52 ▲1.2942.27 ▲11.34
WordPress Popular Posts /wp-admin/options-general.php?page=wordpress-popular-posts4.7750.11

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 103 new files
Database: 3 new tables, 10 new options
New tables
wp_popularpostsdata
wp_popularpostssummary
wp_popularpoststransients
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
wpp_ver
wpp_settings_config
db_upgraded
widget_wpp
wpp_performance_nag
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for WordPress Popular Posts
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,862 ▲10014.19 ▼0.171.78 ▲0.0240.53 ▼3.51
Dashboard /wp-admin2,257 ▲805.68 ▲0.0889.08 ▼14.1440.07 ▼5.77
Posts /wp-admin/edit.php2,109 ▲91.98 ▼0.0342.78 ▲7.3938.31 ▲2.68
Add New Post /wp-admin/post-new.php6,372 ▲4,84527.79 ▲4.36860.88 ▲184.0256.07 ▲2.36
Media Library /wp-admin/upload.php1,409 ▲64.24 ▲0.0598.63 ▼0.6340.62 ▼2.02
WordPress Popular Posts /wp-admin/options-general.php?page=wordpress-popular-posts1,3365.18145.64117.45

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/wordpress-popular-posts/uninstall.php+59
    rmdir(wp-content/uploads/wordpress-popular-posts): Directory not empty
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_wpp

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% 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
Please fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wordpress-popular-posts/src/Admin/admin-page.php
  • 17× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WordPressPopularPosts\\Rest\\Endpoint' not found in wp-content/plugins/wordpress-popular-posts/src/Rest/TaxonomiesEndpoint.php:4
    • > PHP Notice
      Undefined variable: current in wp-content/plugins/wordpress-popular-posts/src/Admin/screen-tools.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WordPressPopularPosts\\Block\\Block' not found in wp-content/plugins/wordpress-popular-posts/src/Block/Widget/Widget.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WordPressPopularPosts\\register_activation_hook() in wp-content/plugins/wordpress-popular-posts/src/Bootstrap.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/wordpress-popular-posts/src/Rest/Endpoint.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WordPressPopularPosts\\Rest\\Endpoint' not found in wp-content/plugins/wordpress-popular-posts/src/Rest/ThumbnailsEndpoint.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WordPressPopularPosts\\Rest\\Endpoint' not found in wp-content/plugins/wordpress-popular-posts/src/Rest/PostsEndpoint.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WordPressPopularPosts\\Rest\\Endpoint' not found in wp-content/plugins/wordpress-popular-posts/src/Rest/WidgetEndpoint.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WordPressPopularPosts\\Rest\\Endpoint' not found in wp-content/plugins/wordpress-popular-posts/src/Rest/ThemesEndpoint.php:7
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wordpress-popular-posts/src/Widget/form.php:2

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
5 plugin tags: widget, posts, top, popularity, popular

wordpress-popular-posts/wordpress-popular-posts.php 92% from 13 tests

The primary PHP file in "WordPress Popular Posts" version 6.3.4 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Domain Path: The domain path folder was not found ("/languages")

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
There were no executable files found in this plugin10,017 lines of code in 93 files:
LanguageFilesBlank linesComment linesLines of code
PHP551,4562,5796,440
JavaScript11263571,726
CSS15230651,341
JSON1100495
SVG13015

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity28.81
▷ Minimum class complexity1.00
▷ Maximum class complexity183.00
Average method complexity5.64
▷ Minimum method complexity1.00
▷ Maximum method complexity83.00
Code structure
Namespaces13
Interfaces1
Traits1
Classes35
▷ Abstract classes38.57%
▷ Concrete classes3291.43%
▷ Final classes00.00%
Methods227
▷ Static methods3917.18%
▷ Public methods18681.94%
▷ Protected methods20.88%
▷ Private methods3917.18%
Functions36
▷ Named functions513.89%
▷ Anonymous functions3186.11%
Constants1
▷ Global constants1100.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 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/flame.png7.10KB4.61KB▼ 35.08%