58% wpecounter

Code Review | WP Views Counter

WordPress plugin WP Views Counter scored58%from 54 tests.

About plugin

  • Plugin page: wpecounter
  • Plugin version: 2.0.1
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-6.0.2
  • WordPress version: 6.3.1
  • First release: May 11, 2013
  • Latest release: Sep 23, 2022
  • Number of updates: 15
  • Update frequency: every 228.1 days
  • Top authors: etruel (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active /24,504 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼0.70MB] [CPU: ▼31.30ms] Passed 4 tests

A check of server-side resources used by WP Views Counter
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1743.96 ▲0.04
Dashboard /wp-admin3.25 ▼0.0627.01 ▼25.13
Posts /wp-admin/edit.php3.25 ▼0.1127.83 ▼22.23
Add New Post /wp-admin/post-new.php3.25 ▼2.6429.51 ▼69.99
Media Library /wp-admin/upload.php3.25 ▲0.0226.36 ▼7.85
WP Views Counter /wp-admin/options-general.php?page=WPeCounter3.2526.21

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_wpecounter
WPeCounter_db_version
widget_recent-comments
WPeCounter_Options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Views Counter
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6013.61 ▼0.614.70 ▲2.9544.80 ▲6.76
Dashboard /wp-admin2,212 ▲245.85 ▲0.99112.80 ▼0.1243.58 ▼3.64
Posts /wp-admin/edit.php2,126 ▲372.02 ▲0.0237.80 ▲0.3035.91 ▲2.00
Add New Post /wp-admin/post-new.php1,547 ▲1918.24 ▼4.91670.77 ▲56.6351.89 ▼3.14
Media Library /wp-admin/upload.php1,397 ▲124.18 ▼0.0697.92 ▼12.9544.84 ▼4.52
WP Views Counter /wp-admin/options-general.php?page=WPeCounter9152.0326.8930.01

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/wpecounter/includes/class-views.php+253
    Undefined index: attachment
  • The plugin did not uninstall successfully, leaving 22 files (0.50MB) in the plugin directory
    • (new file) includes/scripts.php
    • (new file) includes/settings.php
    • (new file) includes/class-views.php
    • (new file) LICENSE
    • (new file) assets/css/settings.css
    • (new file) includes/plugin-utils.php
    • (new file) assets/js/settings.js
    • (new file) includes/functions.php
    • (new file) includes/version.php
    • (new file) README.md
    • ...
  • The uninstall procedure has failed, leaving 10 options in the database
    • WPeCounter_db_version
    • widget_theysaidso_widget
    • db_upgraded
    • widget_wpecounter
    • recovery_mode_email_last_sent
    • WPeCounter_Options
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

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=WPeCounter
    • > Notice in wp-content/plugins/wpecounter/includes/class-views.php+253
    Undefined index: attachment

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
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wpecounter/includes/widget.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Tags: There are too many tags (11 tag instead of maximum 10)
  • Screenshots: Add an image for screenshot #1 (Legacy Widget to Display Popular Posts (types).)
Please take inspiration from this readme.txt

wpecounter/wpecounter.php 92% from 13 tests

This is the main PHP file of "WP Views Counter" version 2.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 146 characters long)

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
Everything looks great! No dangerous files found in this plugin1,042 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP9230516798
PO File285132227
Markdown117017

PHP code Passed 2 tests

A short 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.28
Average class complexity11.14
▷ Minimum class complexity3.00
▷ Maximum class complexity28.00
Average method complexity2.42
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods50
▷ Static methods1734.00%
▷ Public methods4794.00%
▷ Protected methods00.00%
▷ Private methods36.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
3 compressed PNG files occupy 0.42MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png103.59KB103.65KB0.00%
screenshot-3.png176.43KB175.86KB0.32%
screenshot-2.png148.45KB148.61KB0.00%