10% jetpack-post-views

Code Review | Jetpack Post Views

WordPress plugin Jetpack Post Views scored10%from 54 tests.

About plugin

  • Plugin page: jetpack-post-views
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.7.1
  • WordPress version: 6.3.1
  • First release: Jan 21, 2013
  • Latest release: Aug 6, 2014
  • Number of updates: 33
  • Update frequency: every 17.1 days
  • Top authors: straker503 (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

400+ active /29,223 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • Install procedure had errors
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in Jetpack_Post_Views is deprecated since version 4.3.0! Use __construct() instead.

Server metrics [RAM: ▼1.57MB] [CPU: ▼52.45ms] Passed 4 tests

An overview of server-side resources used by Jetpack Post Views
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.42 ▼1.0414.59 ▼33.70
Dashboard /wp-admin2.44 ▼0.9012.08 ▼53.88
Posts /wp-admin/edit.php2.44 ▼0.9115.25 ▼34.52
Add New Post /wp-admin/post-new.php2.44 ▼3.4412.98 ▼87.71
Media Library /wp-admin/upload.php2.44 ▼0.7914.28 ▼20.78
Jetpack Post Views /wp-admin/options-general.php?page=jetpack_post_views2.4412.10

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
widget_jetpack-post-views-widget
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
jetpack-post-views_version
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Jetpack Post Views
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.24 ▼0.051.63 ▼0.2938.52 ▼9.16
Dashboard /wp-admin2,202 ▲225.63 ▼0.0294.31 ▲1.6344.41 ▲1.59
Posts /wp-admin/edit.php2,101 ▲11.94 ▼0.0442.99 ▲5.3536.14 ▲3.40
Add New Post /wp-admin/post-new.php1,531 ▲323.15 ▼0.14676.39 ▲19.3255.17 ▲1.66
Media Library /wp-admin/upload.php1,407 ▲74.18 ▼0.04103.86 ▼2.0541.68 ▼4.66
Jetpack Post Views /wp-admin/options-general.php?page=jetpack_post_views9912.0326.2343.10

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in Jetpack_Post_Views is deprecated since version 4.3.0! Use __construct() instead.
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_jetpack-post-views-widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=jetpack_post_views
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in Jetpack_Post_Views is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=jetpack_post_views
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=jetpack_post_views
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_option() in wp-content/plugins/jetpack-post-views/jetpack-post-views.php:35

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

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
2 plugin tags: jetpack, post views

jetpack-post-views/jetpack-post-views.php 92% from 13 tests

Analyzing the main PHP file in "Jetpack Post Views" version 1.1.0
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 236 characters long)

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 plugin793 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2166137793

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity88.00
▷ Minimum class complexity88.00
▷ Maximum class complexity88.00
Average method complexity5.58
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected