72% post-views-new

Code Review | Post Views

WordPress plugin Post Views scored72%from 54 tests.

About plugin

  • Plugin page: post-views-new
  • Plugin version: 4.2
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Nov 2, 2013
  • Latest release: Dec 26, 2016
  • Number of updates: 33
  • Update frequency: every 35.0 days
  • Top authors: bansod_deven (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,911 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by Post Views
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0153.39 ▲6.56
Dashboard /wp-admin3.32 ▲0.0148.94 ▼4.80
Posts /wp-admin/edit.php3.37 ▲0.0151.57 ▲1.25
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.29 ▼43.19
Media Library /wp-admin/upload.php3.24 ▲0.0135.29 ▼0.86
Post Views /wp-admin/options-general.php?page=post_views3.2336.34

Server storage [IO: ▲0.11MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
It is recommended to fix the following issues
  • Illegal file modification detected: 1 file (4.00KB) outside of "wp-content/plugins/post-views-new/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Post Views
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5813.21 ▼1.091.74 ▼0.2442.85 ▲2.95
Dashboard /wp-admin2,225 ▲194.87 ▼0.98106.06 ▼13.5039.80 ▼15.04
Posts /wp-admin/edit.php2,107 ▲71.97 ▼0.0240.95 ▲3.5933.19 ▲0.40
Add New Post /wp-admin/post-new.php1,529 ▲317.43 ▲0.01656.57 ▼43.6345.38 ▼16.63
Media Library /wp-admin/upload.php1,404 ▲14.14 ▼0.0796.60 ▼5.6642.83 ▼3.51
Post Views /wp-admin/options-general.php?page=post_views8572.0225.8133.35

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 were found after uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=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=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 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/post-views-new/views/notice.php
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Notice
      Undefined variable: posts in wp-content/plugins/post-views-new/views/postviews_table_row.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_posts() in wp-content/plugins/post-views-new/post_views_admin.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/post-views-new/post_views.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/post-views-new/views/admin_index.php:20
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/post-views-new/views/postviews_table_row.php on line 17
    • > PHP Notice
      Undefined variable: post_id in wp-content/plugins/post-views-new/views/notice.php on line 18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Requires at least: The plugin version is formatted incorrectly
The official readme.txt is a good inspiration

post-views-new/post_views.php 92% from 13 tests

The main file in "Post Views" v. 4.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("post-views-new.php" instead of "post_views.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected150 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP53697150

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
There are no PNG files in this plugin