78% persian-date

Code Review | Persian Date

WordPress plugin Persian Date scored78%from 54 tests.

About plugin

  • Plugin page: persian-date
  • Plugin version: 0.1.3
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4.1
  • WordPress version: 6.3.1
  • First release: Nov 26, 2019
  • Latest release: Sep 5, 2020
  • Number of updates: 12
  • Update frequency: every 23.6 days
  • Top authors: mahdiy (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

4,000+ active /16,952 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.43MB] [CPU: ▼1.55ms] Passed 4 tests

Server-side resources used by Persian Date
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /6.28 ▲2.8247.19 ▲7.20
Dashboard /wp-admin6.09 ▲2.7455.36 ▼8.03
Posts /wp-admin/edit.php6.12 ▲2.7760.36 ▲15.45
Add New Post /wp-admin/post-new.php6.00 ▲0.1181.19 ▼12.08
Media Library /wp-admin/upload.php3.34 ▲0.1138.65 ▲6.72
تاریخ شمسی /wp-admin/options-general.php?page=pd-option3.3030.62

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 178 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Persian Date
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.43 ▼0.161.72 ▼0.1046.91 ▼1.35
Dashboard /wp-admin2,210 ▲195.83 ▲0.93101.03 ▼14.6043.77 ▼3.44
Posts /wp-admin/edit.php2,096 ▲102.04 ▲0.0739.22 ▲3.0638.50 ▲3.17
Add New Post /wp-admin/post-new.php1,544 ▲122.89 ▲4.58588.28 ▼55.7853.27 ▲1.39
Media Library /wp-admin/upload.php1,392 ▲74.30 ▲0.1095.54 ▼14.2945.20 ▲1.40
تاریخ شمسی /wp-admin/options-general.php?page=pd-option8372.0326.6156.38

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

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
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/persian-date/vendor/symfony/translation/Resources/bin/translation-status.php
  • 71× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Class 'Symfony\\Contracts\\Translation\\TranslatorInterface' not found in wp-content/plugins/persian-date/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php on line 24
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Translation\\Formatter\\IntlFormatterInterface' not found in wp-content/plugins/persian-date/vendor/symfony/translation/Formatter/IntlFormatter.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/persian-date/vendor/symfony/translation-contracts/Test/TranslatorTest.php:31
    • > PHP Fatal error
      Uncaught Error: Interface 'Carbon\\CarbonInterface' not found in wp-content/plugins/persian-date/vendor/nesbot/carbon/src/Carbon/Carbon.php:509
    • > PHP Fatal error
      Uncaught Error: Interface 'Assert\\AssertionFailedException' not found in wp-content/plugins/persian-date/vendor/beberlei/assert/lib/Assert/InvalidArgumentException.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Translator' not found in wp-content/plugins/persian-date/vendor/nesbot/carbon/src/Carbon/Translator.php:18
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/persian-date/vendor/symfony/translation/Resources/bin/translation-status.php on line 54
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Loader\\FileLoader' not found in wp-content/plugins/persian-date/vendor/symfony/translation/Loader/JsonFileLoader.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Dumper\\FileDumper' not found in wp-content/plugins/persian-date/vendor/symfony/translation/Dumper/YamlFileDumper.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\DependencyInjection\\Compiler\\CompilerPassInterface' not found in wp-content/plugins/persian-date/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: persian date, date, calendar, shamsi, jalali

persian-date/persian-date.php Passed 13 tests

Analyzing the main PHP file in "Persian Date" version 0.1.3
41 characters long description:
تاریخ شمسی برای وردپرس

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin23,370 lines of code in 165 files:
LanguageFilesBlank linesComment linesLines of code
PHP1424,26317,36118,831
XSD392482,803
JSON900845
Markdown73320816
XML20061
YAML22014

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 159)
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity22.46
▷ Minimum class complexity1.00
▷ Maximum class complexity296.00
Average method complexity3.12
▷ Minimum method complexity1.00
▷ Maximum method complexity159.00
Code structure
Namespaces23
Interfaces18
Traits20
Classes87
▷ Abstract classes55.75%
▷ Concrete classes8294.25%
▷ Final classes22.44%
Methods1,546
▷ Static methods43628.20%
▷ Public methods1,38189.33%
▷ Protected methods915.89%
▷ Private methods744.79%
Functions120
▷ Named functions5545.83%
▷ Anonymous functions6554.17%
Constants152
▷ Global constants53.29%
▷ Class constants14796.71%
▷ Public constants147100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin