73% awesome-post-views-counter

Code Review | Awesome Post Views Counter

WordPress plugin Awesome Post Views Counter scored73%from 54 tests.

About plugin

  • Plugin page: awesome-post-view...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.7
  • WordPress version: 6.3.1
  • First release: Oct 29, 2018
  • Latest release: Oct 29, 2018
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: raihancse (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /554 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼12.38ms] Passed 4 tests

Analyzing server-side resources used by Awesome Post Views Counter
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.25 ▲0.7950.13 ▲9.87
Dashboard /wp-admin4.10 ▲0.7552.19 ▼13.50
Posts /wp-admin/edit.php4.15 ▲0.7950.64 ▲8.02
Add New Post /wp-admin/post-new.php3.90 ▼1.9941.19 ▼46.14
Media Library /wp-admin/upload.php3.95 ▲0.7236.51 ▲2.11
Post Views Counter /wp-admin/options-general.php?page=post-views-counter3.9234.07

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 26 new files
Database: 1 new table, 7 new options
New tables
wp_post_views
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_post_views_counter_list_widget
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Awesome Post Views Counter: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,891 ▲14514.97 ▲0.588.22 ▲6.3143.24 ▼0.21
Dashboard /wp-admin2,270 ▲795.89 ▲1.00168.06 ▲65.3641.12 ▲2.23
Posts /wp-admin/edit.php2,149 ▲602.08 ▲0.1047.12 ▲9.6638.47 ▲7.70
Add New Post /wp-admin/post-new.php1,520 ▲117.46 ▼5.61667.77 ▼29.9855.39 ▲2.90
Media Library /wp-admin/upload.php1,392 ▲104.19 ▼0.0495.92 ▼33.4443.11 ▼7.01
Post Views Counter /wp-admin/options-general.php?page=post-views-counter1,3921.8833.4549.98

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/awesome-post-views-counter/includes/ajax.php

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from), #2 (This is the second screen shot)
  • Plugin Name: Please specify the plugin name on the first line ( === awesome-post-views-counter === )
You can look at the official readme.txt

awesome-post-views-counter/post-views-counter.php 85% from 13 tests

The main file in "Awesome Post Views Counter" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("awesome-post-views-counter.php" instead of "post-views-counter.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
Success! There were no dangerous files found in this plugin4,008 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP147651,0763,236
CSS31310487
JavaScript66950285

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity39.42
▷ Minimum class complexity1.00
▷ Maximum class complexity109.00
Average method complexity4.57
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes18.33%
Methods129
▷ Static methods10.78%
▷ Public methods11891.47%
▷ Protected methods10.78%
▷ Private methods107.75%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants562.50%
▷ Class constants337.50%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
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
images/logo-dfactory.png2.92KB1.92KB▼ 34.20%