83% ainoblocks-patterns

Code Review | AinoBlocks Patterns

WordPress plugin AinoBlocks Patterns scored83%from 54 tests.

About plugin

  • Plugin page: ainoblocks-patterns
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1+
  • WordPress version: 6.3.1
  • First release: Feb 27, 2023
  • Latest release: Feb 27, 2023
  • Number of updates: 2
  • Update frequency: every 1.5 days
  • Top authors: elmastudio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /519 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.10MB] [CPU: ▼9.27ms] Passed 4 tests

This is a short check of server-side resources used by AinoBlocks Patterns
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1138.08 ▼5.99
Dashboard /wp-admin3.45 ▲0.1148.72 ▼23.76
Posts /wp-admin/edit.php3.50 ▲0.1551.65 ▲1.28
Add New Post /wp-admin/post-new.php5.97 ▲0.0896.83 ▼4.29
Media Library /wp-admin/upload.php3.31 ▲0.0838.31 ▼3.02
Install Plugins /wp-admin/plugins.php?page=tgmpa-install-plugins3.3835.01

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 75 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for AinoBlocks Patterns
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,870 ▲12413.66 ▼0.891.80 ▼0.1140.96 ▼3.82
Dashboard /wp-admin2,251 ▲485.79 ▼0.09100.25 ▼15.1944.35 ▲1.05
Posts /wp-admin/edit.php2,142 ▲452.09 ▲0.0741.41 ▲4.7440.40 ▲6.05
Add New Post /wp-admin/post-new.php1,552 ▲1217.46 ▼0.85665.64 ▲11.7263.69 ▼0.55
Media Library /wp-admin/upload.php1,438 ▲384.24 ▼0.19102.82 ▼0.1149.22 ▲6.07
Install Plugins /wp-admin/plugins.php?page=tgmpa-install-plugins9712.0825.2429.91

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 23× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ainoblocks-patterns/inc/patterns/pricing/default/008.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/ainoblocks-patterns/assets/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ainoblocks-patterns/inc/patterns/pricing/variant/008.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ainoblocks-patterns/inc/patterns/headings/variant/004.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ainoblocks-patterns/inc/patterns/headers/default/060.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ainoblocks-patterns/inc/patterns/pricing/variant/007.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ainoblocks-patterns/inc/patterns/pricing/default/007.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ainoblocks-patterns/inc/block-patterns.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ainoblocks-patterns/inc/patterns/heroes/default/003.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ainoblocks-patterns/inc/patterns/headings/variant/005.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Contributors: The plugin contributors field is not present
You can look at the official readme.txt

ainoblocks-patterns/ainoblocks-patterns.php 77% from 13 tests

"AinoBlocks Patterns" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: The description should be shorter than 140 characters (currently 155 characters long)

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
Good job! No executable or dangerous file extensions detected4,165 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP249081,6784,165

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity48.14
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity4.27
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods101
▷ Static methods54.95%
▷ Public methods7877.23%
▷ Protected methods2322.77%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants350.00%
▷ Class constants350.00%
▷ Public constants3100.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
10 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/default/brand-05.png4.50KB2.17KB▼ 51.80%
assets/images/default/brand-04.png6.32KB2.88KB▼ 54.35%
assets/images/default/brand-01.png5.19KB2.39KB▼ 53.92%
assets/images/variant/brand-03.png3.22KB1.60KB▼ 50.42%
assets/images/default/brand-03.png3.23KB1.62KB▼ 49.80%