84% post-type-archive-mapping

Code Review | Custom Query Blocks

WordPress plugin Custom Query Blocks scored84%from 54 tests.

About plugin

  • Plugin page: post-type-archive...
  • Plugin version: 5.1.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.2
  • WordPress version: 6.3.1
  • First release: Sep 30, 2018
  • Latest release: Mar 17, 2023
  • Number of updates: 121
  • Update frequency: every 13.5 days
  • Top authors: ronalfy (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

1,000+ active /23,426 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.83MB] [CPU: ▲4.06ms] Passed 4 tests

This is a short check of server-side resources used by Custom Query Blocks
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.32 ▲0.8644.31 ▼1.35
Dashboard /wp-admin4.15 ▲0.8558.73 ▲5.64
Posts /wp-admin/edit.php4.20 ▲0.8559.27 ▲7.01
Add New Post /wp-admin/post-new.php6.72 ▲0.84109.29 ▲4.93
Media Library /wp-admin/upload.php4.01 ▲0.7844.17 ▲7.36
Custom Query Blocks /wp-admin/options-general.php?page=custom-query-blocks3.9838.83

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 37 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Custom Query Blocks
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.56 ▲0.271.75 ▼0.3839.90 ▼5.82
Dashboard /wp-admin2,199 ▲225.64 ▼0.0389.00 ▲2.9441.84 ▲3.73
Posts /wp-admin/edit.php2,101 ▲11.95 ▼0.0738.71 ▲2.6637.40 ▲0.17
Add New Post /wp-admin/post-new.php6,201 ▲4,66419.36 ▲0.98902.79 ▲267.0855.56 ▼7.37
Media Library /wp-admin/upload.php1,407 ▲74.25 ▲0.0995.80 ▼14.8744.97 ▲0.24
Custom Query Blocks /wp-admin/options-general.php?page=custom-query-blocks9002.0529.8029.99

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

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

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
The following issues need your attention
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'PTAM\\Includes\\Admin\\Tabs\\Tabs' not found in wp-content/plugins/post-type-archive-mapping/includes/admin/tabs/class-support.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PTAM\\Includes\\Admin\\Tabs\\Tabs' not found in wp-content/plugins/post-type-archive-mapping/includes/admin/tabs/class-settings.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/post-type-archive-mapping/post-type-archive-mapping.php:539

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: 404 page, map pages, archives, post type block, category grid

post-type-archive-mapping/post-type-archive-mapping.php Passed 13 tests

The entry point to "Custom Query Blocks" version 5.1.6 is a PHP file that has certain tags in its header comment area
99 characters long description:
Map your post type and term archives to a page and use our Gutenberg blocks to show posts or terms.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin3,770 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP183361,1533,018
JSON300730
SVG10019
CSS2002
JavaScript1011

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 124)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity34.80
▷ Minimum class complexity1.00
▷ Maximum class complexity143.00
Average method complexity6.15
▷ Minimum method complexity1.00
▷ Maximum method complexity124.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes15
▷ Abstract classes16.67%
▷ Concrete classes1493.33%
▷ Final classes00.00%
Methods102
▷ Static methods4140.20%
▷ Public methods9997.06%
▷ Protected methods00.00%
▷ Private methods32.94%
Functions3
▷ Named functions00.00%
▷ Anonymous functions3100.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/logo.png9.80KB4.08KB▼ 58.33%
img/loading.png21.33KB9.82KB▼ 53.96%