10% integrai

Code Review | Integrai

WordPress plugin Integrai scored10%from 54 tests.

About plugin

  • Plugin page: integrai
  • Plugin version: 1.0.23
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.7
  • WordPress version: 6.3.1
  • First release: Jul 3, 2021
  • Latest release: Jun 22, 2022
  • Number of updates: 25
  • Update frequency: every 14.8 days
  • Top authors: integrai (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,698 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/integrai/admin/wc-config/class-wc-integration-integrai-settings-integration.php+8
    require_once(wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-settings-api.php): failed to open stream: No such file or directory

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.75ms] Passed 4 tests

Analyzing server-side resources used by Integrai
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0042.13 ▲1.51
Dashboard /wp-admin3.31 ▲0.0045.28 ▼5.55
Posts /wp-admin/edit.php3.36 ▲0.0046.41 ▲1.43
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.24 ▼8.39
Media Library /wp-admin/upload.php3.23 ▲0.0034.76 ▲2.50

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 68 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Integrai: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.48 ▲0.191.84 ▼0.0144.06 ▲0.15
Dashboard /wp-admin2,206 ▲214.87 ▼0.00111.58 ▼5.4638.90 ▼7.95
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0339.11 ▲2.7234.82 ▼0.16
Add New Post /wp-admin/post-new.php1,514 ▼1917.54 ▼5.46620.42 ▼50.6649.88 ▼0.29
Media Library /wp-admin/upload.php1,388 ▲64.16 ▼0.0394.15 ▼9.1141.23 ▼0.65

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

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)
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 132× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant INTEGRAI__PLUGIN_DIR - assumed 'INTEGRAI__PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/integrai/includes/class-integrai-activator.php on line 6
    • > PHP Warning
      include_once(): Failed opening 'INTEGRAI__PLUGIN_DIRincludes/class-integrai-helpers.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/integrai/includes/controller/class-integrai-controller-config.php on line 4
    • > PHP Warning
      Use of undefined constant INTEGRAI__PLUGIN_DIR - assumed 'INTEGRAI__PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/integrai/includes/controller/class-integrai-controller-pix.php on line 2
    • > PHP Warning
      Use of undefined constant INTEGRAI__PLUGIN_DIR - assumed 'INTEGRAI__PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/integrai/includes/class-integrai-activator.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/integrai/includes/controller/class-integrai-controller-pix.php:6
    • > PHP Warning
      Use of undefined constant INTEGRAI__PLUGIN_DIR - assumed 'INTEGRAI__PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/integrai/includes/model/class-integrai-model-events.php on line 3
    • > PHP Warning
      include_once(): Failed opening 'INTEGRAI__PLUGIN_DIRincludes/class-integrai-helpers.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/integrai/includes/controller/class-integrai-controller-pix.php on line 3
    • > PHP Warning
      include_once(INTEGRAI__PLUGIN_DIRincludes/class-integrai-helpers.php): failed to open stream: No such file or directory in wp-content/plugins/integrai/includes/model/class-integrai-model-helper.php on line 3
    • > PHP Warning
      include_once(INTEGRAI__PLUGIN_DIRincludes/class-integrai-api.php): failed to open stream: No such file or directory in wp-content/plugins/integrai/includes/controller/class-integrai-controller-boleto.php on line 2
    • > PHP Warning
      include_once(): Failed opening 'INTEGRAI__PLUGIN_DIRpublic/class-integrai-payment-method.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/integrai/public/class-integrai-payment-method-boleto.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please a description for screenshot #1 in integrai/assets to your readme.txt
  • Donate link: Invalid url: "-"
The official readme.txt might help

integrai/integrai.php 92% from 13 tests

The primary PHP file in "Integrai" version 1.0.23 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.6" instead of "5.0.0")

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 plugin3,260 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
PHP518922083,259
JavaScript1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity13.18
▷ Minimum class complexity1.00
▷ Maximum class complexity84.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes34
▷ Abstract classes00.00%
▷ Concrete classes34100.00%
▷ Final classes00.00%
Methods245
▷ Static methods62.45%
▷ Public methods18374.69%
▷ Protected methods00.00%
▷ Private methods6225.31%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants16
▷ Global constants212.50%
▷ Class constants1487.50%
▷ Public constants14100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.76MB with 0.48MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
.wordpress-org/icon-256x256.png20.66KB6.70KB▼ 67.57%
.wordpress-org/icon-128x128.png11.08KB3.63KB▼ 67.22%
.wordpress-org/screenshot-1.png113.70KB32.87KB▼ 71.09%
.wordpress-org/banner-1544x500.png466.78KB222.85KB▼ 52.26%
.wordpress-org/banner-772x250.png169.42KB70.61KB▼ 58.32%