10% tp-postviews-count-popular-posts-widgets

Code Review | PostViews Count & Popular Posts Widgets

WordPress plugin PostViews Count & Popular Posts Widgetsscored10%from 54 tests.

About plugin

  • Plugin page: tp-postviews-coun...
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.1-4.8.1
  • WordPress version: 6.3.1
  • First release: Sep 18, 2017
  • Latest release: Mar 13, 2018
  • Number of updates: 6
  • Update frequency: every 29.5 days
  • Top authors: raja3c (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /4,950 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/tp-postviews-count-popular-posts-widgets/public/tp_pviews_functions.php+11
    Function create_function() is deprecated

Server metrics [RAM: ▼1.96MB] [CPU: ▼55.39ms] Passed 4 tests

An overview of server-side resources used by PostViews Count & Popular Posts Widgets
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.445.10 ▼35.90
Dashboard /wp-admin2.05 ▼1.266.31 ▼48.03
Posts /wp-admin/edit.php2.05 ▼1.315.84 ▼46.27
Add New Post /wp-admin/post-new.php2.05 ▼3.845.25 ▼91.35
Media Library /wp-admin/upload.php2.05 ▼1.185.51 ▼28.74

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_tp_pviews_show_popular
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

PostViews Count & Popular Posts Widgets: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲4613.23 ▼1.421.72 ▼0.2639.13 ▼7.49
Dashboard /wp-admin2,236 ▲305.99 ▲0.11102.85 ▼5.5475.14 ▲27.85
Posts /wp-admin/edit.php2,121 ▲212.02 ▲0.0239.45 ▲3.3234.79 ▼0.84
Add New Post /wp-admin/post-new.php1,562 ▲1418.29 ▼5.02705.20 ▲18.9867.83 ▲2.93
Media Library /wp-admin/upload.php1,412 ▲94.15 ▼0.09106.37 ▲0.2980.37 ▲33.55

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
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/tp-postviews-count-popular-posts-widgets/public/tp_pviews_functions.php+11
    Function create_function() is deprecated
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_tp_pviews_show_popular
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

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 | 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
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/tp-postviews-count-popular-posts-widgets/public/tp_pviews_output.php:7

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

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === PostViews Count & Popular Posts Widgets=== )
You can look at the official readme.txt

tp-postviews-count-popular-posts-widgets/tp_postviews.php 85% from 13 tests

"PostViews Count & Popular Posts Widgets" version 1.1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("tp-postviews-count-popular-posts-widgets.php" instead of "tp_postviews.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin455 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP615851382
CSS11164
JavaScript1079

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity11.00
▷ Minimum class complexity1.00
▷ Maximum class complexity36.00
Average method complexity2.32
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods38
▷ Static methods00.00%
▷ Public methods3489.47%
▷ Protected methods00.00%
▷ Private methods410.53%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
(invalid) admin/images/favicon.png1.12KB0.00KB▼ 100.00%