84% persian-elementor

Code Review | Persian Elementor

WordPress plugin Persian Elementor scored84%from 54 tests.

About plugin

  • Plugin page: persian-elementor
  • Plugin version: 2.6.6
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Apr 29, 2019
  • Latest release: Oct 25, 2023
  • Number of updates: 397
  • Update frequency: every 4.1 days
  • Top authors: elementorir (100%)

Code review

54 tests

User reviews

24 reviews

Install metrics

30,000+ active /469,424 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.65ms] Passed 4 tests

An overview of server-side resources used by Persian Elementor
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0236.18 ▼4.04
Dashboard /wp-admin3.33 ▲0.0244.30 ▼2.38
Posts /wp-admin/edit.php3.38 ▲0.0242.78 ▼4.37
Add New Post /wp-admin/post-new.php5.91 ▲0.0279.05 ▼11.79
Media Library /wp-admin/upload.php3.25 ▲0.0234.31 ▼0.52

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 211 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Persian Elementor: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲7014.03 ▼0.261.81 ▲0.1443.43 ▲7.63
Dashboard /wp-admin2,212 ▲315.60 ▼0.1282.41 ▼15.1441.10 ▼0.14
Posts /wp-admin/edit.php2,114 ▲142.05 ▲0.0734.87 ▼2.3135.72 ▲0.70
Add New Post /wp-admin/post-new.php1,542 ▲1623.15 ▲0.38603.30 ▼34.8963.70 ▲6.31
Media Library /wp-admin/upload.php1,420 ▲234.28 ▼0.08100.23 ▼29.1842.83 ▼6.47

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/persian-elementor/includes/admin/admin.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function PersianElementor\\get_option() in wp-content/plugins/persian-elementor/plugin.php:113
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/persian-elementor/includes/localization.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/persian-elementor/includes/library/icon.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/persian-elementor/includes/template/module.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/persian-elementor/includes/library/fonts.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
8 plugin tags: iranian, iran, farsi, parsi, fa_ir...

persian-elementor/persian-elementor.php 92% from 13 tests

This is the main PHP file of "Persian Elementor" version 2.6.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 275 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected13,167 lines of code in 98 files:
LanguageFilesBlank linesComment linesLines of code
PHP782,3011,2389,634
CSS819271,350
JavaScript5239101,312
PO File1154216397
Markdown2850379
SVG30052
JSON10043

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity19.89
▷ Minimum class complexity1.00
▷ Maximum class complexity152.00
Average method complexity5.79
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes57
▷ Abstract classes23.51%
▷ Concrete classes5596.49%
▷ Final classes11.82%
Methods225
▷ Static methods3214.22%
▷ Public methods225100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions28
▷ Named functions2692.86%
▷ Anonymous functions27.14%
Constants5
▷ Global constants240.00%
▷ Class constants360.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon.png1.24KB0.60KB▼ 51.74%
assets/images/dashboard.png15.58KB7.02KB▼ 54.92%
includes/admin/codestar-framework/assets/images/checkerboard.png2.29KB2.54KB0.00%
assets/images/about.png9.54KB5.37KB▼ 43.74%