84% nastrikejcz

Code Review | Nastříkej

WordPress plugin Nastříkej scored84%from 54 tests.

About plugin

  • Plugin page: nastrikejcz
  • Plugin version: 0.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.8.1
  • WordPress version: 6.3.1
  • First release: Jun 6, 2014
  • Latest release: Oct 8, 2021
  • Number of updates: 14
  • Update frequency: every 197.1 days
  • Top authors: vEnCa-X (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /685 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼1.71ms] Passed 4 tests

This is a short check of server-side resources used by Nastříkej
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0441.30 ▲2.13
Dashboard /wp-admin3.34 ▼0.0048.30 ▼7.88
Posts /wp-admin/edit.php3.39 ▲0.0442.97 ▲2.39
Add New Post /wp-admin/post-new.php5.92 ▲0.0488.30 ▼3.49
Media Library /wp-admin/upload.php3.26 ▲0.0438.45 ▲3.81

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_nastrikejpositions
widget_nastrikejcompetitions
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Nastříkej
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.28 ▼0.071.76 ▲0.2545.34 ▲7.68
Dashboard /wp-admin2,192 ▲115.54 ▼0.1887.66 ▼17.4142.05 ▲1.59
Posts /wp-admin/edit.php2,100 ▲31.96 ▼0.0335.91 ▲1.0634.78 ▲0.96
Add New Post /wp-admin/post-new.php1,528 ▼023.09 ▲0.09662.12 ▲38.1458.63 ▲10.53
Media Library /wp-admin/upload.php1,394 ▼64.17 ▲0.01104.01 ▼5.3245.64 ▲3.06

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_nastrikejcompetitions
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • widget_nastrikejpositions
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means 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
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/nastrikejcz/nastrikej.php:15
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/nastrikejcz/views/admin-competitions.php:7
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/nastrikejcz/views/admin-positions.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Screenshot #1 (2.) image not found
The official readme.txt is a good inspiration

nastrikejcz/nastrikej.php 92% from 13 tests

The main file in "Nastříkej" v. 0.4.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("nastrikejcz.php" instead of "nastrikej.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin323 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP46414323

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity9.50
▷ Minimum class complexity9.00
▷ Maximum class complexity10.00
Average method complexity3.12
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected