68% salavat-counter

Code Review | salavat counter Plugin

WordPress plugin salavat counter Plugin scored68%from 54 tests.

About plugin

  • Plugin page: salavat-counter
  • Plugin version: 0.9
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Oct 22, 2014
  • Latest release: Jul 8, 2022
  • Number of updates: 22
  • Update frequency: every 128.0 days
  • Top authors: Goback2 (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

70+ active /2,559 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▼5.86ms] Passed 4 tests

An overview of server-side resources used by salavat counter Plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2039.86 ▼5.24
Dashboard /wp-admin3.50 ▲0.1549.12 ▼9.40
Posts /wp-admin/edit.php3.61 ▲0.2546.02 ▲1.52
Add New Post /wp-admin/post-new.php6.08 ▲0.1981.53 ▼10.31
Media Library /wp-admin/upload.php3.42 ▲0.1935.64 ▲4.44
salavat-counter /wp-admin/options-general.php?page=salavatcounter-options3.4235.99

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 42 new files
Database: 1 new table, 8 new options
New tables
wp_salavatcounter
New WordPress options
widget_salavat_shomar
salavat_counter_db_version
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for salavat counter Plugin
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,879 ▲12913.72 ▼0.657.94 ▲6.3437.27 ▲0.03
Dashboard /wp-admin2,199 ▲215.55 ▼0.0582.27 ▼16.9638.70 ▼3.38
Posts /wp-admin/edit.php2,104 ▲72.02 ▲0.0532.32 ▼2.7530.59 ▼4.48
Add New Post /wp-admin/post-new.php1,531 ▲523.28 ▼0.04618.62 ▼69.3546.42 ▼18.96
Media Library /wp-admin/upload.php1,404 ▲14.16 ▲0.0194.61 ▼3.5941.89 ▼2.35
salavat-counter /wp-admin/options-general.php?page=salavatcounter-options1,0843.1137.5229.98

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_salavatcounter
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • salavat_counter_db_version
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_salavat_shomar

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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 items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/salavat-counter/index.php
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/salavat-counter/wp-table-class.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/salavat-counter/wp-table-class.php on line 3
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/salavat-counter/wp-table-class.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/salavat-counter/wp-table-options.php:23

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 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots lack descriptions #2, #3, #4, #5, #6, #7 in salavat-counter/assets to your readme.txt
Please take inspiration from this readme.txt

salavat-counter/index.php 85% from 13 tests

This is the main PHP file of "salavat counter Plugin" version 0.9, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("salavat-counter.php" instead of "index.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected1,546 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP3169136954
CSS62332328
PO File17386144
JavaScript2126102
HTML101118

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity18.33
▷ Minimum class complexity4.00
▷ Maximum class complexity34.00
Average method complexity3.74
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/styles/green/salavat.png2.11KB1.22KB▼ 42.16%
css/styles/red/salavat.png1.89KB0.98KB▼ 48.06%
css/styles/blue/salavat.png1.96KB0.98KB▼ 50.07%
css/styles/phosphor/salavat.png1.99KB0.98KB▼ 50.61%
css/styles/pink/salavat.png2.00KB0.98KB▼ 50.91%