64% dp-post-views

Code Review | DP Post Views Counter

WordPress plugin DP Post Views Counter scored64%from 54 tests.

About plugin

  • Plugin page: dp-post-views
  • Plugin version: 1.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.1-5.2.2
  • WordPress version: 6.3.1
  • First release: Jul 29, 2019
  • Latest release: Aug 12, 2019
  • Number of updates: 8
  • Update frequency: every 2.1 days
  • Top authors: denisatu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,604 total downloads

Benchmarks

Plugin footprint 48% 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: ▼7.10ms] Passed 4 tests

A check of server-side resources used by DP Post Views Counter
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.55 ▼1.27
Dashboard /wp-admin3.31 ▲0.0141.02 ▼6.15
Posts /wp-admin/edit.php3.36 ▲0.0145.99 ▼3.21
Add New Post /wp-admin/post-new.php5.89 ▲0.0178.28 ▼13.05
Media Library /wp-admin/upload.php3.23 ▲0.0033.66 ▼6.00

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for DP Post Views Counter
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲5613.19 ▼1.181.68 ▲0.0637.88 ▼6.74
Dashboard /wp-admin2,203 ▲214.85 ▼1.00112.74 ▲8.9844.75 ▼1.60
Posts /wp-admin/edit.php2,092 ▲32.18 ▲0.1539.00 ▲2.2535.23 ▼1.11
Add New Post /wp-admin/post-new.php1,542 ▲918.25 ▼5.09639.47 ▼68.7555.37 ▲1.63
Media Library /wp-admin/upload.php1,388 ▲34.21 ▼0.0295.35 ▼4.5239.61 ▼6.82

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > Error in wp-content/plugins/dp-post-views/dppv_check.php+3
    Cannot redeclare dppv_check_field() (previously declared in wp-content/plugins/dp-post-views/dppv_check.php:3)
  • Incomplete uninstall procedure, leaving 6 files (0.01MB) in the plugin directory
    • (new file) images/eyes.png
    • (new file) stylesheet/style.css
    • (new file) dppv-post-views.php
    • (new file) readme.txt
    • (new file) uninstall.php
    • (new file) dppv_check.php
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/dp-post-views/dppv-post-views.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: hits, post views, posts, counter, postviews...

dp-post-views/dppv-post-views.php 92% from 13 tests

"DP Post Views Counter" version 1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("dp-post-views.php" instead of "dppv-post-views.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin61 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP3221056
CSS1005

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.26
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%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
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/eyes.png3.81KB2.34KB▼ 38.58%