74% top-10

Code Review | Top 10 - WordPress Popular posts by WebberZone

WordPress plugin Top 10 - WordPress Popular posts by WebberZone scored74%from 54 tests.

About plugin

  • Plugin page: top-10
  • Plugin version: 3.3.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.4
  • WordPress version: 6.3.1
  • First release: Jan 30, 2009
  • Latest release: Nov 3, 2023
  • Number of updates: 159
  • Update frequency: every 34.8 days
  • Top authors: Ajay (100%)

Code review

54 tests

User reviews

95 reviews

Install metrics

20,000+ active /1,047,423 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲1.59MB] [CPU: ▲10.25ms] Passed 4 tests

Server-side resources used by Top 10 - WordPress Popular posts by WebberZone
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.33 ▲0.8749.63 ▲11.00
Dashboard /wp-admin5.24 ▲1.8959.26 ▲0.41
Posts /wp-admin/edit.php5.24 ▲1.8971.36 ▲23.45
Add New Post /wp-admin/post-new.php7.76 ▲1.87112.32 ▲19.92
Media Library /wp-admin/upload.php4.97 ▲1.7447.06 ▲9.66
Import/Export /wp-admin/admin.php?page=tptn_exim_page4.9642.18
Tools /wp-admin/admin.php?page=tptn_tools_page5.0744.43
Daily Popular Posts /wp-admin/admin.php?page=tptn_popular_posts&orderby=daily_count&order=desc5.0645.87
Settings /wp-admin/admin.php?page=tptn_options_page5.0599.16
Popular Posts /wp-admin/admin.php?page=tptn_popular_posts5.0645.23
Dashboard /wp-admin/admin.php?page=tptn_dashboard5.0847.12

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 105 new files
Database: 2 new tables, 9 new options
New tables
wp_top_ten
wp_top_ten_daily
New WordPress options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
tptn_settings
theysaidso_admin_options
widget_widget_tptn_count
widget_widget_tptn_pop
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Top 10 - WordPress Popular posts by WebberZone
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,918 ▲17114.36 ▲0.021.78 ▼0.0144.67 ▲1.40
Dashboard /wp-admin2,326 ▲1495.65 ▼0.0392.90 ▲3.7345.04 ▲2.33
Posts /wp-admin/edit.php2,219 ▲1161.98 ▲0.0340.76 ▼1.2037.67 ▲0.26
Add New Post /wp-admin/post-new.php6,497 ▲4,96327.23 ▲2.05884.58 ▲280.8866.95 ▼4.80
Media Library /wp-admin/upload.php1,449 ▲464.29 ▲0.0898.40 ▼5.9644.69 ▼1.20
Import/Export /wp-admin/admin.php?page=tptn_exim_page1,1422.0023.8232.65
Tools /wp-admin/admin.php?page=tptn_tools_page1,1622.0031.4931.23
Daily Popular Posts /wp-admin/admin.php?page=tptn_popular_posts&orderby=daily_count&order=desc1,3362.1435.3528.34
Settings /wp-admin/admin.php?page=tptn_options_page2,6616.21127.4188.92
Popular Posts /wp-admin/admin.php?page=tptn_popular_posts1,3362.1534.6331.13
Dashboard /wp-admin/admin.php?page=tptn_dashboard1,2544.21107.0336.51

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
You still need to fix the following
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_top_ten
    • wp_top_ten_daily
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not 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
The following issues need your attention
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/top-10/includes/wz-pluggables.php:36
    • > PHP Notice
      Undefined variable: daily in wp-content/plugins/top-10/includes/frontend/feed-rss2-popular-posts.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function tptn_get_option() in wp-content/plugins/top-10/includes/frontend/feed-rss2-popular-posts.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/top-10/includes/admin/settings/sidebar.php:14

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
These attributes need to be fixed:
  • Screenshots: Add an image for screenshot #14 (Top 10 Gutenberg block)
The official readme.txt might help

top-10/top-10.php Passed 13 tests

The main PHP file in "Top 10 - WordPress Popular posts by WebberZone" ver. 3.3.3 adds more information about the plugin and also serves as the entry point for this plugin
101 characters long description:
Count daily and total visits per post and display the most popular posts based on the number of views

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin10,175 lines of code in 78 files:
LanguageFilesBlank linesComment linesLines of code
PHP451,9534,5837,312
PO File14064731,073
JavaScript23111108946
CSS63138695
JSON10074
Markdown137064
XML10011

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity25.89
▷ Minimum class complexity1.00
▷ Maximum class complexity69.00
Average method complexity3.82
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces8
Interfaces0
Traits0
Classes35
▷ Abstract classes00.00%
▷ Concrete classes35100.00%
▷ Final classes12.86%
Methods309
▷ Static methods11236.25%
▷ Public methods30699.03%
▷ Protected methods10.32%
▷ Private methods20.65%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants675.00%
▷ Class constants225.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
14 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/admin/css/images/ui-icons_2e83ff_256x240.png4.44KB4.17KB▼ 6.02%
includes/admin/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.27KB0.18KB▼ 35.00%
includes/admin/css/images/ui-icons_cd0a0a_256x240.png4.44KB4.17KB▼ 6.02%
includes/admin/images/fb.png1.51KB1.59KB0.00%
includes/admin/css/images/ui-icons_454545_256x240.png6.83KB4.17KB▼ 38.86%