68% law-firm-blocks

Code Review | Law Firm Posts And Blocks

WordPress plugin Law Firm Posts And Blocks scored68%from 54 tests.

About plugin

  • Plugin page: law-firm-blocks
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0.2
  • WordPress version: 6.3.1
  • First release: Mar 2, 2021
  • Latest release: Sep 19, 2022
  • Number of updates: 10
  • Update frequency: every 56.6 days
  • Top authors: encoresky (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /401 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.95MB] [CPU: ▼38.71ms] Passed 4 tests

A check of server-side resources used by Law Firm Posts And Blocks
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.03 ▼0.4416.07 ▼22.42
Dashboard /wp-admin3.07 ▼0.2419.08 ▼33.66
Posts /wp-admin/edit.php3.07 ▼0.2919.80 ▼26.10
Add New Post /wp-admin/post-new.php3.07 ▼2.8221.71 ▼72.66
Media Library /wp-admin/upload.php3.07 ▼0.1720.83 ▼15.41
Categories /wp-admin/edit-tags.php?taxonomy=testimonials-category&post_type=testimonials3.0720.39
All Testimonials /wp-admin/edit.php?post_type=testimonials3.0719.51
All Practice Areas /wp-admin/edit.php?post_type=practice-areas3.0719.41
Categories /wp-admin/edit-tags.php?taxonomy=practice-areas-category&post_type=practice-areas3.0719.30
Tags /wp-admin/edit-tags.php?taxonomy=testimonials-tag&post_type=testimonials3.0717.65
Add New /wp-admin/post-new.php?post_type=practice-areas3.0719.86
Add New /wp-admin/post-new.php?post_type=testimonials3.0719.40
Tags /wp-admin/edit-tags.php?taxonomy=practice-areas-tag&post_type=practice-areas3.0719.34

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 87 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Law Firm Posts And Blocks
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,293 ▲54725.02 ▲10.6243.74 ▲41.8636.26 ▼4.69
Dashboard /wp-admin2,366 ▲18010.92 ▲5.03144.08 ▲24.1142.74 ▼1.37
Posts /wp-admin/edit.php2,275 ▲1839.62 ▲7.5887.14 ▲48.6036.21 ▲2.57
Add New Post /wp-admin/post-new.php6,267 ▲4,73218.96 ▼4.22789.20 ▲118.8640.50 ▼15.30
Media Library /wp-admin/upload.php1,568 ▲18011.28 ▲7.10159.97 ▲62.1666.43 ▲23.86
Categories /wp-admin/edit-tags.php?taxonomy=testimonials-category&post_type=testimonials1,4489.2166.4426.67
All Testimonials /wp-admin/edit.php?post_type=testimonials2,5609.6687.3434.23
All Practice Areas /wp-admin/edit.php?post_type=practice-areas2,5579.6077.0331.71
Categories /wp-admin/edit-tags.php?taxonomy=practice-areas-category&post_type=practice-areas1,4519.3169.8427.84
Tags /wp-admin/edit-tags.php?taxonomy=testimonials-tag&post_type=testimonials1,4239.2873.0727.21
Add New /wp-admin/post-new.php?post_type=practice-areas6,22920.23836.2636.02
Add New /wp-admin/post-new.php?post_type=testimonials1,57416.86734.3733.72
Tags /wp-admin/edit-tags.php?taxonomy=practice-areas-tag&post_type=practice-areas1,4239.3376.3025.64

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/law-firm-blocks/guttenberg-blocks/banner/index.php+56
    Undefined offset: 0
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 26 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=practice-areas-tag&post_type=practice-areas
    • > Notice in wp-content/plugins/law-firm-blocks/guttenberg-blocks/banner/index.php+56
    Undefined offset: 0
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=testimonials
    • > User deprecated in wp-includes/functions.php+5828
    Hook block_categories is deprecated since version 5.8.0! Use block_categories_all instead.

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
Please take a closer look at the following
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/law-firm-blocks/shortcodes/testimonials.php:48
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/law-firm-blocks/shortcodes/introduction.php:34
    • > PHP Warning
      require_once(ABSPATHwp-includes/pluggable.php): failed to open stream: No such file or directory in wp-content/plugins/law-firm-blocks/starter-content.php on line 97
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/law-firm-blocks/guttenberg-blocks/index.php:18
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-includes/pluggable.php' (include_path='.:/usr/share/php') in wp-content/plugins/law-firm-blocks/starter-content.php on line 97
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/law-firm-blocks/shortcodes/blog.php:87
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/law-firm-blocks/shortcodes/index.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/law-firm-blocks/shortcodes/3cta.php:75
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/law-firm-blocks/starter-content.php on line 97
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/law-firm-blocks/shortcodes/logo-slider.php:53

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
No plugin tags provided

law-firm-blocks/post_and_blocks.php 92% from 13 tests

This is the main PHP file of "Law Firm Posts And Blocks" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("law-firm-blocks.php" instead of "post_and_blocks.php")

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
No dangerous file extensions were detected2,558 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
PHP191842441,355
JavaScript87755986
CSS121154203
SVG10014

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions29
▷ Named functions29100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
41 PNG files occupy 7.12MB with 4.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/phone-call.png0.96KB0.86KB▼ 10.16%
guttenberg-blocks/3cta/img/img-2.png9.40KB2.92KB▼ 68.88%
img/icon-2.png4.15KB2.64KB▼ 36.39%
guttenberg-blocks/logo-slider/img/logo-img-2.png45.36KB7.21KB▼ 84.09%
img/logo-img-2.png41.53KB7.21KB▼ 82.63%