78% mywp-custom-patterns

Code Review | MyWP Block Pattern - Block Pattern Builder for WordPress

WordPress plugin MyWP Block Pattern - Block Pattern Builder for WordPress scored78%from 54 tests.

About plugin

  • Plugin page: mywp-custom-patterns
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9
  • WordPress version: 6.3.1
  • First release: Dec 13, 2021
  • Latest release: Jun 7, 2022
  • Number of updates: 16
  • Update frequency: every 11.2 days
  • Top authors: whodunitagency (93.75%)bmartinent (12.5%)

Code review

54 tests

User reviews

5 reviews

Install metrics

300+ active /2,170 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.17MB] [CPU: ▼0.93ms] Passed 4 tests

Analyzing server-side resources used by MyWP Block Pattern - Block Pattern Builder for WordPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1746.89 ▲1.52
Dashboard /wp-admin3.46 ▲0.1653.35 ▲1.02
Posts /wp-admin/edit.php3.58 ▲0.2248.46 ▼1.24
Add New Post /wp-admin/post-new.php6.09 ▲0.2091.23 ▼5.02
Media Library /wp-admin/upload.php3.39 ▲0.1644.21 ▲9.39
Categories /wp-admin/edit-tags.php?taxonomy=mywp-category-custom-patterns&post_type=mywp-custom-patterns3.3940.17
All Custom Patterns /wp-admin/edit.php?post_type=mywp-custom-patterns3.4442.79
Add /wp-admin/post-new.php?post_type=mywp-custom-patterns6.1386.02

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

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

Browser metrics Passed 4 tests

Checking browser requirements for MyWP Block Pattern - Block Pattern Builder for WordPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲4814.35 ▼0.002.19 ▲0.1045.12 ▲0.06
Dashboard /wp-admin2,243 ▲635.64 ▼0.0186.17 ▼1.9541.70 ▲0.34
Posts /wp-admin/edit.php2,145 ▲451.99 ▲0.0338.24 ▲3.6434.09 ▲2.00
Add New Post /wp-admin/post-new.php1,723 ▲19722.34 ▼1.34678.52 ▼21.6063.25 ▲8.08
Media Library /wp-admin/upload.php1,445 ▲424.24 ▼0.0296.80 ▼0.4439.53 ▼5.11
Categories /wp-admin/edit-tags.php?taxonomy=mywp-category-custom-patterns&post_type=mywp-custom-patterns1,2952.1328.8030.10
All Custom Patterns /wp-admin/edit.php?post_type=mywp-custom-patterns1,1651.9332.5086.24
Add /wp-admin/post-new.php?post_type=mywp-custom-patterns1,51916.90866.2630.13

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
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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 take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/mywp-custom-patterns/mywp-custom-patterns.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/mywp-custom-patterns/admin-parts/admin-header.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Whodunit\\MywpCustomPatterns\\Init\\Plugin' not found in wp-content/plugins/mywp-custom-patterns/core/Core.php:5

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: gutenberg, patterns, block-editor, builder, block pattern...

mywp-custom-patterns/mywp-custom-patterns.php 92% from 13 tests

The main PHP script in "MyWP Block Pattern - Block Pattern Builder for WordPress" version 1.2 is automatically included on every request by WordPress
It is important to fix the following:
  • Domain Path: The domain path folder does not exist ("/languages")

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 detected1,256 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP16292191861
JavaScript24890267
CSS26491
JSON20021
SVG30016

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity12.11
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.92
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes9
▷ Abstract classes111.11%
▷ Concrete classes888.89%
▷ Final classes00.00%
Methods53
▷ Static methods1426.42%
▷ Public methods5094.34%
▷ Protected methods11.89%
▷ Private methods23.77%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin