10% top-visited-post

Code Review | Top visited post

WordPress plugin Top visited post scored10%from 54 tests.

About plugin

  • Plugin page: top-visited-post
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5-4.1.1
  • WordPress version: 6.3.1
  • First release: Jul 4, 2014
  • Latest release: Mar 4, 2015
  • Number of updates: 3
  • Update frequency: every 82.7 days
  • Top authors: Webster.K (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /983 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • Install procedure had errors
    • > Error in wp-content/plugins/top-visited-post/top_visited_post.php+20
    Uncaught Error: Call to undefined function mysql_query() in wp-content/plugins/top-visited-post/top_visited_post.php:20
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): top_visited_post_install()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/includes/plugin.php(693): do_action()

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.06ms] Passed 4 tests

This is a short check of server-side resources used by Top visited post
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0040.87 ▼3.84
Dashboard /wp-admin3.31 ▲0.0049.10 ▼2.77
Posts /wp-admin/edit.php3.36 ▲0.0047.06 ▼5.32
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.94 ▼12.29
Media Library /wp-admin/upload.php3.23 ▲0.0040.31 ▲2.45

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Top visited post
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.30 ▼0.112.07 ▲0.2144.31 ▲0.05
Dashboard /wp-admin2,195 ▲185.67 ▼0.0394.04 ▼11.0437.05 ▼8.40
Posts /wp-admin/edit.php2,100 ▲32.03 ▼0.0036.76 ▼0.2833.69 ▼2.84
Add New Post /wp-admin/post-new.php1,545 ▲523.24 ▲5.07684.57 ▲19.3356.19 ▼3.12
Media Library /wp-admin/upload.php1,400 ▼04.23 ▼0.01101.25 ▼3.6145.10 ▲1.58

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_next_scheduled() in wp-content/plugins/top-visited-post/top_visited_post.php:102

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 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Jak plugin vypadá (how to plugin look)), #2 (Jak plugin vypadá od verze 2.0 (how to plugin look - v2.0))
  • Donate link: Please fix this invalid url: ""
The official readme.txt is a good inspiration

top-visited-post/top_visited_post.php 92% from 13 tests

The main file in "Top visited post" v. 2.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("top-visited-post.php" instead of "top_visited_post.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin107 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP12821107

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin