74% pageviews-counter

Code Review | PageViews Counter

WordPress plugin PageViews Counter scored 74% from 54 tests.

About plugin

  • Plugin page: pageviews-counter
  • Plugin version: 2.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.3
  • WordPress version: 6.3.1
  • First release: Mar 25, 2020
  • Latest release: Aug 22, 2023
  • Number of updates: 22
  • Update frequency: every 56.6 days
  • Top authors: bouk (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active / 1,557 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.47MB] [CPU: ▼0.14ms] Passed 4 tests

Server-side resources used by PageViews Counter
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.96 ▲0.5043.59 ▼5.88
Dashboard /wp-admin3.79 ▲0.4952.79 ▲0.24
Posts /wp-admin/edit.php3.85 ▲0.4957.75 ▲3.75
Add New Post /wp-admin/post-new.php6.31 ▲0.4396.08 ▲1.32
Media Library /wp-admin/upload.php3.72 ▲0.4941.99 ▲5.58

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

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

Browser metrics Passed 4 tests

A check of browser resources used by PageViews Counter
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▼1114.48 ▲1.261.73 ▼0.2540.25 ▼5.19
Dashboard /wp-admin2,206 ▼04.85 ▼0.04105.67 ▲0.9742.27 ▲4.37
Posts /wp-admin/edit.php2,099 ▲312.00 ▼0.0141.19 ▲6.6936.29 ▲3.68
Add New Post /wp-admin/post-new.php1,533 ▼023.31 ▼0.03638.36 ▼41.7454.66 ▲7.31
Media Library /wp-admin/upload.php1,391 ▼04.28 ▲0.0993.74 ▼8.6841.74 ▼4.31

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

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 no errors were found, this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 134× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Cache\\CacheException' not found in wp-content/plugins/pageviews-counter/vendor/phpfastcache/phpfastcache/lib/Phpfastcache/Exceptions/PhpfastcacheExceptionInterface.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpfastcache\\Core\\Pool\\ExtendedCacheItemPoolInterface' not found in wp-content/plugins/pageviews-counter/vendor/phpfastcache/phpfastcache/lib/Phpfastcache/Drivers/Couchbase/Driver.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'Phpfastcache\\Exceptions\\PhpfastcacheRootException' not found in wp-content/plugins/pageviews-counter/vendor/phpfastcache/phpfastcache/lib/Phpfastcache/Exceptions/PhpfastcacheUnsupportedOperationException.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\SimpleCache\\CacheInterface' not found in wp-content/plugins/pageviews-counter/vendor/phpfastcache/phpfastcache/lib/Phpfastcache/Helper/Psr16Adapter.php:30
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpfastcache\\Core\\Item\\ExtendedCacheItemInterface' not found in wp-content/plugins/pageviews-counter/vendor/phpfastcache/phpfastcache/lib/Phpfastcache/Drivers/Cassandra/Item.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'Phpfastcache\\Config\\ConfigurationOption' not found in wp-content/plugins/pageviews-counter/vendor/phpfastcache/phpfastcache/lib/Phpfastcache/Drivers/Devtrue/Config.php:21
    • > PHP Fatal error
      Trait 'Latte\\Strict' not found in wp-content/plugins/pageviews-counter/vendor/latte/latte/src/Latte/Compiler/Token.php on line 16
    • > PHP Fatal error
      Uncaught Error: Interface 'Latte\\Loader' not found in wp-content/plugins/pageviews-counter/vendor/latte/latte/src/Latte/Loaders/StringLoader.php:18
    • > PHP Fatal error
      Trait 'Phpfastcache\\Core\\Item\\ItemExtendedTrait' not found in wp-content/plugins/pageviews-counter/vendor/phpfastcache/phpfastcache/lib/Phpfastcache/Core/Item/ItemBaseTrait.php on line 24
    • > PHP Fatal error
      Uncaught Error: Class 'Phpfastcache\\Exceptions\\PhpfastcacheRootException' not found in wp-content/plugins/pageviews-counter/vendor/phpfastcache/phpfastcache/lib/Phpfastcache/Exceptions/PhpfastcacheDriverException.php:22

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Donate link: Invalid url: ""
You can look at the official readme.txt

pageviews-counter/pageviews-counter.php Passed 13 tests

Analyzing the main PHP file in "PageViews Counter" version 2.0.0
30 characters long description:
Lightweight pageviews counter.

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
These items require your attention
  • Do not include executable or dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/pageviews-counter/vendor/bin/latte-lint.bat
18,114 lines of code in 228 files:
LanguageFilesBlank linesComment linesLines of code
PHP1974,0399,38016,028
Markdown1839001,449
JSON900562
YAML215064
XML1117
DOS Batch1004

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity12.24
▷ Minimum class complexity1.00
▷ Maximum class complexity225.00
Average method complexity2.77
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces52
Interfaces28
Traits11
Classes151
▷ Abstract classes21.32%
▷ Concrete classes14998.68%
▷ Final classes21.34%
Methods1,281
▷ Static methods14811.55%
▷ Public methods1,06282.90%
▷ Protected methods16813.11%
▷ Private methods513.98%
Functions64
▷ Named functions34.69%
▷ Anonymous functions6195.31%
Constants50
▷ Global constants48.00%
▷ Class constants4692.00%
▷ Public constants4495.65%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin