89% digikala-affiliate

Code Review | digikala affiliate

WordPress plugin digikala affiliate scored89%from 54 tests.

About plugin

  • Plugin page: digikala-affiliate
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.2
  • WordPress version: 6.3.1
  • First release: Mar 14, 2023
  • Latest release: Apr 7, 2023
  • Number of updates: 7
  • Update frequency: every 3.4 days
  • Top authors: mrrashidpour (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /210 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼2.73ms] Passed 4 tests

An overview of server-side resources used by digikala affiliate
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0440.07 ▲0.89
Dashboard /wp-admin3.35 ▲0.0451.89 ▼1.12
Posts /wp-admin/edit.php3.46 ▲0.1048.80 ▼1.22
Add New Post /wp-admin/post-new.php5.93 ▲0.0488.15 ▼9.45
Media Library /wp-admin/upload.php3.27 ▲0.0436.67 ▲1.47

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for digikala affiliate
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲6913.32 ▼1.061.77 ▲0.1248.26 ▲6.60
Dashboard /wp-admin2,224 ▲184.90 ▲0.0199.97 ▼6.1068.86 ▲28.16
Posts /wp-admin/edit.php2,118 ▲182.02 ▼0.0334.79 ▼3.2533.77 ▼4.64
Add New Post /wp-admin/post-new.php1,692 ▲14722.40 ▼0.63757.47 ▲67.5447.90 ▼18.95
Media Library /wp-admin/upload.php1,418 ▲184.15 ▼0.08104.75 ▼8.3649.15 ▲2.99

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Congratulations! This plugin passed the SRP test

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 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: Screenshot #1 (Preview of digikala affiliate setting page) image required
The official readme.txt might help

digikala-affiliate/digikala-affiliate.php 85% from 13 tests

The main PHP script in "digikala affiliate" version 1.1.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("6.0" instead of "5.0.0")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

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 detected269 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP23118201
PO File1141568

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity1.44
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods19.09%
▷ Public methods1090.91%
▷ Protected methods00.00%
▷ Private methods19.09%
Functions9
▷ Named functions888.89%
▷ Anonymous functions111.11%
Constants2
▷ Global constants2100.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
3 PNG files occupy 0.06MB with 0.04MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png54.47KB18.24KB▼ 66.51%
img/logo-m.png2.63KB0.92KB▼ 65.07%
img/logo.png8.60KB3.47KB▼ 59.62%