83% modoro-ybai-interaction

Code Review | YBAI Affiliate

WordPress plugin YBAI Affiliate scored83%from 54 tests.

About plugin

  • Plugin page: modoro-ybai-inter...
  • Plugin version: 1.2.7
  • PHP version: 7.4.16
  • WordPress compatibility: 1.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Dec 24, 2021
  • Latest release: Nov 7, 2023
  • Number of updates: 13
  • Update frequency: every 52.6 days
  • Top authors: modoro (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /524 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
Install script ran successfully

Server metrics [RAM: ▲0.35MB] [CPU: ▼4.21ms] Passed 4 tests

This is a short check of server-side resources used by YBAI Affiliate
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3341.29 ▼2.91
Dashboard /wp-admin3.69 ▲0.3947.29 ▼1.88
Posts /wp-admin/edit.php3.74 ▲0.3948.83 ▼7.98
Add New Post /wp-admin/post-new.php6.23 ▲0.3487.53 ▼4.05
Media Library /wp-admin/upload.php3.55 ▲0.3340.99 ▲4.66
Cài Đặt /wp-admin/admin.php?page=ybai-config3.5233.93
Kết Nối /wp-admin/admin.php?page=ybai-connect3.5232.49

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 44 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for YBAI Affiliate
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,842 ▲5514.67 ▲0.291.63 ▼0.3540.86 ▼0.68
Dashboard /wp-admin2,232 ▲555.54 ▼0.0989.27 ▼1.7678.84 ▲33.04
Posts /wp-admin/edit.php2,156 ▲591.98 ▲0.0337.95 ▼1.2337.70 ▼3.77
Add New Post /wp-admin/post-new.php1,729 ▲20022.38 ▼0.73802.72 ▲135.4652.21 ▼11.02
Media Library /wp-admin/upload.php1,446 ▲434.17 ▼0.00102.77 ▲2.5567.25 ▲24.99
Cài Đặt /wp-admin/admin.php?page=ybai-config9292.0125.3943.55
Kết Nối /wp-admin/admin.php?page=ybai-connect9112.0527.2134.55

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% 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
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/modoro-ybai-interaction/loader.php:47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/modoro-ybai-interaction/loader.php:47

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Requires php: The plugin version is formatted incorrectly
  • Screenshots: Please describe screenshot #2 in modoro-ybai-interaction/assets to your readme.txt
Please take inspiration from this readme.txt

modoro-ybai-interaction/ybai.php 92% from 13 tests

The main PHP file in "YBAI Affiliate" ver. 1.2.7 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("modoro-ybai-interaction.php" instead of "ybai.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin7,134 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
CSS8599694,490
PHP143096921,692
SVG301828
INI25070
JavaScript24353
Markdown1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity19.50
▷ Minimum class complexity1.00
▷ Maximum class complexity134.00
Average method complexity3.74
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods81
▷ Static methods1113.58%
▷ Public methods7997.53%
▷ Protected methods22.47%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants430.77%
▷ Class constants969.23%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/chosen-sprite.png0.51KB0.88KB0.00%
assets/images/remove.png0.32KB0.41KB0.00%
assets/images/tooltip.png0.60KB0.54KB▼ 9.15%