89% popularposts

Code Review | Popular Posts

WordPress plugin Popular Posts scored89%from 54 tests.

About plugin

  • Plugin page: popularposts
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-4.7.2
  • WordPress version: 6.3.1
  • First release: Feb 16, 2017
  • Latest release: Feb 16, 2017
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: aihimel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,899 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.01MB] [CPU: ▼7.41ms] Passed 4 tests

A check of server-side resources used by Popular Posts
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.39 ▼0.0727.16 ▼14.51
Dashboard /wp-admin3.31 ▲0.0151.57 ▲1.50
Posts /wp-admin/edit.php3.37 ▲0.0146.38 ▼2.51
Add New Post /wp-admin/post-new.php5.90 ▲0.0184.05 ▼13.15
Media Library /wp-admin/upload.php3.24 ▲0.0136.56 ▲0.53

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_popular_posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Popular Posts
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.25 ▼0.401.73 ▼0.3042.92 ▼0.90
Dashboard /wp-admin2,195 ▲155.60 ▼0.0986.66 ▼15.7443.49 ▼2.13
Posts /wp-admin/edit.php2,097 ▼02.00 ▼0.0137.39 ▼1.1832.90 ▼2.29
Add New Post /wp-admin/post-new.php1,543 ▲923.39 ▼0.13686.72 ▲43.9451.95 ▲1.11
Media Library /wp-admin/upload.php1,403 ▲64.21 ▼0.0695.30 ▼2.4441.03 ▼5.27

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_popular_posts
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP Passed 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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === popularposts === )
Please take inspiration from this readme.txt

popularposts/gb_post_popularity_counter.php 92% from 13 tests

The primary PHP file in "Popular Posts" version 1.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("popularposts.php" instead of "gb_post_popularity_counter.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin6,896 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
CSS2796,753
PHP12450141
JavaScript2062

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity5.00
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.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
There were not PNG files found in your plugin