52% stop-war-stop-putin

Code Review | Stop War! Stop Putin!

WordPress plugin Stop War! Stop Putin! scored52%from 54 tests.

About plugin

  • Plugin page: stop-war-stop-putin
  • Plugin version: 1.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0-5.9.1
  • WordPress version: 6.3.1
  • First release: Mar 13, 2022
  • Latest release: Mar 13, 2022
  • Number of updates: 8
  • Update frequency: every 0.1 days
  • Top authors: stopwarstopputin (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

50+ active /727 total downloads

Benchmarks

Plugin footprint 65% 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.54MB] [CPU: ▼5.06ms] Passed 4 tests

An overview of server-side resources used by Stop War! Stop Putin!
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.03 ▲0.5641.67 ▼10.30
Dashboard /wp-admin3.88 ▲0.5846.27 ▼0.71
Posts /wp-admin/edit.php3.93 ▲0.5753.79 ▲7.30
Add New Post /wp-admin/post-new.php6.42 ▲0.5387.25 ▼13.06
Media Library /wp-admin/upload.php3.74 ▲0.5137.71 ▲3.83
Block /wp-admin/admin.php?page=stop_war_stop_putin3.7236.74
Statistics /wp-admin/admin.php?page=stop_war_stop_putin-statistics3.7138.79
Settings /wp-admin/admin.php?page=stop_war_stop_putin-settings4.2335.72

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 69 new files
Database: 1 new table, 43 new options
New tables
wp_ip2location_country_blocker_log
New WordPress options
stopwarstopputin_blocker_api_key
stopwarstopputin_blocker_access_email_notification
stopwarstopputin_blocker_frontend_block_mode
stopwarstopputin_blocker_backend_banlist
stopwarstopputin_blocker_px_api_key
stopwarstopputin_blocker_token
stopwarstopputin_blocker_backend_ip_whitelist
stopwarstopputin_blocker_frontend_whitelist_logged_user
stopwarstopputin_blocker_backend_redirect_url
stopwarstopputin_blocker_log_enabled
...

Browser metrics Passed 4 tests

Checking browser requirements for Stop War! Stop Putin!
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,855 ▲9414.35 ▲0.091.57 ▼0.1943.94 ▼8.97
Dashboard /wp-admin2,263 ▲955.68 ▲0.1188.03 ▼4.7539.75 ▼0.77
Posts /wp-admin/edit.php2,165 ▲652.06 ▲0.0736.04 ▼5.0130.56 ▼7.81
Add New Post /wp-admin/post-new.php1,552 ▲2623.08 ▲0.13586.61 ▼23.5562.79 ▲7.19
Media Library /wp-admin/upload.php1,468 ▲714.25 ▲0.01108.42 ▲10.6646.90 ▲4.90
Block /wp-admin/admin.php?page=stop_war_stop_putin1,1622.0334.8533.23
Statistics /wp-admin/admin.php?page=stop_war_stop_putin-statistics8903.1292.7128.66
Settings /wp-admin/admin.php?page=stop_war_stop_putin-settings9092.0826.0123.79

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie tables detected upon uninstall: 1 table
    • wp_ip2location_country_blocker_log
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • stopwarstopputin_blocker_download_ipv4_only
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/stop-war-stop-putin/vendor/ip2location/ip2proxy-php/tests/bootstrap.php
    • > /wp-content/plugins/stop-war-stop-putin/vendor/ip2location/ip2location-php/tests/bootstrap.php
  • 11× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/stop-war-stop-putin/vendor/ip2location/ip2location-php/tests/DatabaseTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/stop-war-stop-putin/vendor/ip2location/ip2location-php/tests/IpToolsTest.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_upload_dir() in wp-content/plugins/stop-war-stop-putin/stopwarstopputin.php:22
    • > PHP Warning
      require(vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/stop-war-stop-putin/vendor/ip2location/ip2proxy-php/examples/example.php on line 3
    • > PHP Fatal error
      require(): Failed opening required 'vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/stop-war-stop-putin/vendor/ip2location/ip2proxy-php/examples/example.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/stop-war-stop-putin/vendor/ip2location/ip2proxy-php/tests/WebServiceTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/stop-war-stop-putin/vendor/ip2location/ip2location-php/tests/WebServiceTest.php:10
    • > PHP Fatal error
      require(): Failed opening required 'vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/stop-war-stop-putin/vendor/ip2location/ip2location-php/examples/example.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/stop-war-stop-putin/vendor/ip2location/ip2proxy-php/tests/DatabaseTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/stop-war-stop-putin/vendor/ip2location/ip2location-php/tests/CountryTest.php:9

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=stop_war_stop_putin-statistics
    • > Console-api (severe) in wp-content/plugins/stop-war-stop-putin/assets/js/chart-js.min.js+12:86747
    Invalid scale configuration for scale: yAxes

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 16 tag instead of maximum 10
You can take inspiration from this readme.txt

stop-war-stop-putin/stopwarstopputin.php 85% from 13 tests

The entry point to "Stop War! Stop Putin!" version 1.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 173 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("stop-war-stop-putin.php" instead of "stopwarstopputin.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
It is important to fix the following items
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .bin - Binary Executable in Windows, macOS, Linux
      • wp-content/plugins/stop-war-stop-putin/assets/IP2LOCATION-LITE-DB1.BIN
6,263 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
PHP281,4102,0495,415
JavaScript86812338
Markdown41210240
JSON300190
CSS415866
XML20014

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity50.88
▷ Minimum class complexity1.00
▷ Maximum class complexity402.00
Average method complexity4.96
▷ Minimum method complexity1.00
▷ Maximum method complexity74.00
Code structure
Namespaces10
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods216
▷ Static methods2612.04%
▷ Public methods11754.17%
▷ Protected methods20.93%
▷ Private methods9744.91%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants104
▷ Global constants32.88%
▷ Class constants10197.12%
▷ Public constants7776.24%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
10 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/step-1-selected.png3.01KB1.35KB▼ 55.06%
assets/img/step-1.png4.04KB1.52KB▼ 62.47%
assets/img/step-end.png31.47KB10.52KB▼ 66.57%
assets/css/chosen-sprite@2x.png0.72KB0.83KB0.00%
assets/img/step-3.png4.88KB1.81KB▼ 62.92%