88% persian-date-short-code

Code Review | persian date shortcode

WordPress plugin persian date shortcode scored 88% from 54 tests.

About plugin

  • Plugin page: persian-date-shor...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.2
  • WordPress version: 5.8.1
  • First release: Oct 13, 2013
  • Latest release: Aug 4, 2019
  • Number of updates: 43
  • Update frequency: every 49.5 days
  • Top authors: ee_persian (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

200+ active / 5,120 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.57MB] [CPU: ▼133.70ms] Passed 4 tests

A check of server-side resources used by persian date shortcode
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.42 ▲0.5843.09 ▲9.15
Dashboard /wp-admin3.68 ▲0.6252.63 ▲8.31
Posts /wp-admin/edit.php3.73 ▲0.6253.45 ▲10.02
Add New Post /wp-admin/post-new.php5.97 ▲0.5497.49 ▼559.65
Media Library /wp-admin/upload.php3.56 ▲0.5640.19 ▲7.41

Server storage [IO: ▲0.23MB] [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: 12 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for persian date shortcode
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲11216.17 ▲0.698.97 ▼0.7546.66 ▼5.85
Dashboard /wp-admin2,972 ▲415.87 ▼0.08137.74 ▼3.08113.24 ▼7.85
Posts /wp-admin/edit.php2,744 ▲52.68 ▼0.0165.33 ▼3.0199.74 ▲6.13
Add New Post /wp-admin/post-new.php1,686 ▲18818.36 ▼0.48354.22 ▼22.57104.17 ▼7.60
Media Library /wp-admin/upload.php1,809 ▲25.00 ▼0.02157.12 ▼0.59118.48 ▼4.40
تاریخ شمسی /wp-admin/options-general.php?page=options-general.php_تاریخ_شمسی1,2853.1774.1658.44

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled successfully, without leaving any zombie files or tables

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/persian-date-short-code/persian-date-shortcode.php:19

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=options-general.php_تاریخ_شمسی
    • > Console-api (warning) in unknown
    /wp-includes/js/jquery/jquery.min.js?ver=3.6.0 1:31592 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at apc_init (/wp-content/plugins/persian-date-short-code/admin-page-class/js/Admin_Page_Class.js:49:22)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/persian-date-short-code/admin-page-class/js/Admin_Page_Class.js:20:3)\n at e (/wp-includes/js/jquery/jquery.min.js?ver=3.6.0:2:30038)\n at t (/wp-includes/js/jquery/jquery.min.js?ver=3.6.0:2:30340)" undefined
    • > GET request to /wp-admin/options-general.php?page=options-general.php_تاریخ_شمسی
    • > Javascript (severe) in unknown
    /wp-includes/js/jquery/jquery.min.js?ver=3.6.0 1:31702 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
9 plugin tags: farsi, iran, jalali, date, parsi...

persian-date-short-code/persian-date-shortcode.php 92% from 13 tests

"persian date shortcode" version 1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("persian-date-short-code.php" instead of "persian-date-shortcode.php")

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
No dangerous file extensions were detected4,213 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP34731,3902,495
CSS41762171,244
JavaScript348249474

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity378.00
▷ Minimum class complexity378.00
▷ Maximum class complexity378.00
Average method complexity3.97
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods127
▷ Static methods00.00%
▷ Public methods12497.64%
▷ Protected methods00.00%
▷ Private methods32.36%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin-page-class/js/FancyCheckbox/images/iphone.png4.68KB2.68KB▼ 42.67%