78% post-views-for-jetpack

Code Review | Post Views for Jetpack

WordPress plugin Post Views for Jetpack scored78%from 54 tests.

About plugin

  • Plugin page: post-views-for-je...
  • Plugin version: 1.5.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.3
  • WordPress version: 6.3.1
  • First release: Oct 17, 2016
  • Latest release: Sep 5, 2023
  • Number of updates: 23
  • Update frequency: every 109.2 days
  • Top authors: jeherve (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

1,000+ active /18,949 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.02MB] [CPU: ▼8.69ms] Passed 4 tests

Server-side resources used by Post Views for Jetpack
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0234.65 ▼6.01
Dashboard /wp-admin3.32 ▲0.0241.44 ▼8.10
Posts /wp-admin/edit.php3.37 ▲0.0145.74 ▼5.96
Add New Post /wp-admin/post-new.php5.91 ▲0.0177.71 ▼14.70
Media Library /wp-admin/upload.php3.25 ▲0.0136.99 ▲3.33

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Post Views for Jetpack
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲9713.26 ▼1.121.87 ▲0.0940.42 ▼2.61
Dashboard /wp-admin2,216 ▲254.86 ▼0.05115.88 ▲6.5744.27 ▼3.05
Posts /wp-admin/edit.php2,095 ▲62.16 ▲0.1339.48 ▼2.1936.66 ▲2.54
Add New Post /wp-admin/post-new.php1,549 ▲1018.18 ▼5.06593.38 ▼101.0978.28 ▲23.20
Media Library /wp-admin/upload.php1,398 ▲104.18 ▼0.0398.74 ▲1.2745.68 ▲3.86

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 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 0% 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/post-views-for-jetpack/jp-post-views.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/post-views-for-jetpack/widgets.jp-post-views.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
4 plugin tags: views, jetpack, stats, post views

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

The principal PHP file in "Post Views for Jetpack" v. 1.5.0 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("post-views-for-jetpack.php" instead of "jp-post-views.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
No dangerous file extensions were detected214 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP358209214

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity6.50
▷ Minimum class complexity4.00
▷ Maximum class complexity9.00
Average method complexity1.85
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods13
▷ Static methods17.69%
▷ Public methods1292.31%
▷ Protected methods00.00%
▷ Private methods17.69%
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

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected