83% wincher-rank-tracker

Code Review | Wincher Rank Tracker

WordPress plugin Wincher Rank Tracker scored83%from 54 tests.

About plugin

  • Plugin page: wincher-rank-tracker
  • Plugin version: 3.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 14, 2014
  • Latest release: Mar 10, 2023
  • Number of updates: 34
  • Update frequency: every 88.5 days
  • Top authors: wincher.com (100%)

Code review

54 tests

User reviews

39 reviews

Install metrics

3,000+ active /59,557 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

Analyzing server-side resources used by Wincher Rank Tracker
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1037.80 ▼6.69
Dashboard /wp-admin3.41 ▲0.0748.03 ▼13.04
Posts /wp-admin/edit.php3.46 ▲0.1043.29 ▲4.55
Add New Post /wp-admin/post-new.php5.97 ▲0.0884.16 ▼16.14
Media Library /wp-admin/upload.php3.27 ▲0.0442.34 ▲11.84

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 223 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Wincher Rank Tracker: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,851 ▲10514.26 ▼0.151.67 ▼0.0438.12 ▼4.61
Dashboard /wp-admin2,248 ▲745.57 ▼0.0185.74 ▼14.1539.87 ▼7.78
Posts /wp-admin/edit.php2,162 ▲622.04 ▲0.0835.30 ▼3.5034.37 ▲3.78
Add New Post /wp-admin/post-new.php1,543 ▲1523.13 ▼0.18690.20 ▲61.7456.32 ▲6.96
Media Library /wp-admin/upload.php1,462 ▲624.19 ▲0.0197.47 ▼1.4640.24 ▼1.66

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • 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 | 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
Almost there! Just fix the following items
  • 63× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/wincher-rank-tracker/vendor/psr/http-message/src/ServerRequestInterface.php:43
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/wincher-rank-tracker/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/wincher-rank-tracker/vendor/psr/http-message/src/RequestInterface.php:24
    • > PHP Fatal error
      Trait 'League\\OAuth2\\Client\\Tool\\RequiredParameterTrait' not found in wp-content/plugins/wincher-rank-tracker/vendor/league/oauth2-client/src/Grant/AbstractGrant.php on line 31
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\TaskQueueInterface' not found in wp-content/plugins/wincher-rank-tracker/vendor/guzzlehttp/promises/src/TaskQueue.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/wincher-rank-tracker/vendor/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wincher-rank-tracker/vendor/guzzlehttp/psr7/src/Stream.php:12
    • > PHP Fatal error
      require_once(): Failed opening required 'lib/byte_safe_strings.php' (include_path='.:/usr/share/php') in wp-content/plugins/wincher-rank-tracker/vendor/paragonie/random_compat/psalm-autoload.php on line 3
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wincher-rank-tracker/vendor/guzzlehttp/psr7/src/BufferStream.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\OAuth2\\Client\\Token\\AccessTokenInterface' not found in wp-content/plugins/wincher-rank-tracker/vendor/league/oauth2-client/src/Token/AccessToken.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
  • Screenshots: Please describe screenshot #3 in wincher-rank-tracker/assets to your readme.txt
The official readme.txt might help

wincher-rank-tracker/wincher.php 92% from 13 tests

The main PHP script in "Wincher Rank Tracker" version 3.0.4 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wincher-rank-tracker.php" instead of "wincher.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected123,531 lines of code in 208 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript320,77718,64588,442
PHP1682,7417,99328,966
Markdown141,17803,481
JSON12101,519
CSS42731,017
SVG30165
XML10019
Dockerfile18010
make1409
Bourne Shell1203

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity14.12
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity3.02
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces23
Interfaces19
Traits9
Classes106
▷ Abstract classes32.83%
▷ Concrete classes10397.17%
▷ Final classes2423.30%
Methods925
▷ Static methods16317.62%
▷ Public methods71577.30%
▷ Protected methods657.03%
▷ Private methods14515.68%
Functions163
▷ Named functions7445.40%
▷ Anonymous functions8954.60%
Constants204
▷ Global constants7838.24%
▷ Class constants12661.76%
▷ Public constants126100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.08MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/flags.png78.70KB26.55KB▼ 66.27%