10% wp-persian

Code Review | WP-Persian

WordPress plugin WP-Persian scored10%from 54 tests.

About plugin

  • Plugin page: wp-persian
  • Plugin version: 3.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.3.2
  • WordPress version: 6.3.1
  • First release: Dec 28, 2012
  • Latest release: Sep 11, 2020
  • Number of updates: 119
  • Update frequency: every 23.7 days
  • Top authors: salemi (100%)

Code review

54 tests

User reviews

30 reviews

Install metrics

10,000+ active /150,356 total downloads

Benchmarks

Plugin footprint 57% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/wp-persian/includes/class-wpp-hooks.php+14
    Trying to get property 'adminpanel_locale' of non-object

Server metrics [RAM: ▲5.63MB] [CPU: ▲27.76ms] 75% from 4 tests

An overview of server-side resources used by WP-Persian
Please take the time to fix the following items
  • Extra RAM: The extra memory usage must be under 5MB (currently 5.63MB on /wp-admin/options-general.php?page=wpp-options)
PageMemory (MB)CPU Time (ms)
Home /6.94 ▲3.4764.03 ▲21.96
Dashboard /wp-admin9.89 ▲6.5579.52 ▲15.62
Posts /wp-admin/edit.php9.90 ▲6.5488.72 ▲40.07
Add New Post /wp-admin/post-new.php11.82 ▲5.94144.94 ▲35.78
Media Library /wp-admin/upload.php9.90 ▲6.6770.43 ▲37.66
فارسی /wp-admin/options-general.php?page=wpp-options9.9066.48

Server storage [IO: ▲11.17MB] [DB: ▲0.39MB] 67% from 3 tests

A short overview of filesystem and database impact
It is recommended to fix the following issues
  • The plugin illegally modified 67 files (3,524.75KB) outside of "wp-content/plugins/wp-persian/" and "wp-content/uploads/"
    • (new file) wp-content/languages/admin-network-fa_IR.po
    • (new file) wp-content/languages/fa_IR-0ce75ad2f775d1cac9696967d484808c.json
    • (new file) wp-content/languages/admin-network-fa_IR.mo
    • (new file) wp-content/languages/fa_IR-0eebe503220d4a00341eb011b92769b4.json
    • (new file) wp-content/languages/admin-fa_IR.mo
    • (new file) wp-content/languages/continents-cities-fa_IR.mo
    • (new file) wp-content/languages/admin-fa_IR.po
    • (new file) wp-content/languages/fa_IR-0cc31205f20441b3df1d1b46100f6b8d.json
    • (new file) wp-content/languages/continents-cities-fa_IR.po
    • (new file) wp-content/languages/fa_IR-17179a5f2930647c89151e365f843b6e.json
    • ...
Filesystem: 114 new files
Database: no new tables, 43 new options
New WordPress options
wpp_frontpage_numbers_the_excerpt
wpp_installed_version
wpp_frontpage_numbers_format_i18n
wpp_adminpanel_font_main
theysaidso_admin_options
widget_wpp_jarchive
wpp_adminpanel_context
wpp_tinymce_bidi_buttons
wpp_adminpanel_numbers_comment
wpp_frontpage_letters
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP-Persian
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,884 ▲13813.84 ▼0.901.77 ▲0.0675.88 ▲31.78
Dashboard /wp-admin2,230 ▲425.33 ▼0.57125.39 ▲18.8081.94 ▲38.16
Posts /wp-admin/edit.php2,110 ▲212.06 ▲0.0445.78 ▲7.0372.77 ▲39.16
Add New Post /wp-admin/post-new.php1,613 ▲8023.41 ▲0.16672.70 ▼8.2559.30 ▲7.06
Media Library /wp-admin/upload.php1,408 ▲264.45 ▲0.19104.94 ▲6.2259.57 ▲16.75
فارسی /wp-admin/options-general.php?page=wpp-options1,0581.8131.9262.92

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 10 options
    • wpp_adminpanel_datepicker
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • wpp_adminpanel_font_nav
    • can_compress_scripts
    • wpp_adminpanel_font_h
    • widget_recent-comments
    • wpp_adminpanel_font_main

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% 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 items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-persian/assets/css/dynamic-css.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 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
10 plugin tags: ltr, date, persian, farsi, jalali...

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

"WP-Persian" version 3.3.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
130 characters long description:
Fast and powerful plugin for support jalali date and persian language in wordpress and woocommerce and all other standard plugins.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin31,417 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PO File613,07819,34927,599
PHP165072722,297
JavaScript71711431,122
CSS63238395
Markdown1504

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity66.17
▷ Minimum class complexity8.00
▷ Maximum class complexity220.00
Average method complexity5.65
▷ Minimum method complexity1.00
▷ Maximum method complexity92.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods84
▷ Static methods3642.86%
▷ Public methods7690.48%
▷ Protected methods22.38%
▷ Private methods67.14%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.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
1 PNG file occupies 0.38MB with 0.23MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
help/Wordpress-Splash-Image.png391.69KB154.90KB▼ 60.45%