10% persian-quote-of-the-day-by-sokhanak

Code Review | Persian Quote of the Day by Sokhanak

WordPress plugin Persian Quote of the Day by Sokhanak scored10%from 54 tests.

About plugin

  • Plugin page: persian-quote-of-...
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.8
  • WordPress version: 6.3.1
  • First release: Jan 23, 2017
  • Latest release: Jun 19, 2017
  • Number of updates: 7
  • Update frequency: every 20.9 days
  • Top authors: sajjadsalemi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /566 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/persian-quote-of-the-day-by-sokhanak/includes/class-widget.php+141
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

Server metrics [RAM: ▼1.83MB] [CPU: ▼58.53ms] Passed 4 tests

A check of server-side resources used by Persian Quote of the Day by Sokhanak
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.16 ▼1.305.00 ▼35.39
Dashboard /wp-admin2.18 ▼1.165.47 ▼57.56
Posts /wp-admin/edit.php2.18 ▼1.176.29 ▼42.85
Add New Post /wp-admin/post-new.php2.18 ▼3.706.26 ▼98.31
Media Library /wp-admin/upload.php2.18 ▼1.057.35 ▼31.40

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 23 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_sokhanak_random_widget
widget_sokhanak_today_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Persian Quote of the Day by Sokhanak
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,876 ▲11513.40 ▼0.968.30 ▲6.0739.90 ▼4.56
Dashboard /wp-admin2,199 ▲225.62 ▲0.0294.03 ▼2.9137.73 ▼6.73
Posts /wp-admin/edit.php2,104 ▲42.03 ▲0.0436.06 ▼2.4736.16 ▲0.19
Add New Post /wp-admin/post-new.php1,530 ▲423.35 ▲0.18677.66 ▲34.3355.35 ▼2.52
Media Library /wp-admin/upload.php1,407 ▲104.20 ▼0.02105.27 ▼0.6843.42 ▼0.72

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
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/persian-quote-of-the-day-by-sokhanak/includes/class-widget.php+141
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
  • Zombie WordPress options were found after uninstall: 8 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_sokhanak_today_widget
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_sokhanak_random_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/persian-quote-of-the-day-by-sokhanak/admin/partials/sokhanak-admin-display.php
    • > /wp-content/plugins/persian-quote-of-the-day-by-sokhanak/public/partials/sokhanak-public-display.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/persian-quote-of-the-day-by-sokhanak/includes/class-widget.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% 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: The official readme.txt is a good inspiration

persian-quote-of-the-day-by-sokhanak/sokhanak.php 85% from 13 tests

The main PHP script in "Persian Quote of the Day by Sokhanak" version 1.3 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("persian-quote-of-the-day-by-sokhanak.php" instead of "sokhanak.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin568 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP13199559562
JavaScript24546
CSS2080

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity4.22
▷ Minimum class complexity1.00
▷ Maximum class complexity11.00
Average method complexity1.63
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods46
▷ Static methods36.52%
▷ Public methods4189.13%
▷ Protected methods00.00%
▷ Private methods510.87%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants480.00%
▷ Class constants120.00%
▷ Public constants1100.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 images were found in this plugin