78% reuse-builder

Code Review | Reuse Builder

WordPress plugin Reuse Builder scored78%from 54 tests.

About plugin

  • Plugin page: reuse-builder
  • Plugin version: 1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.5.1
  • WordPress version: 6.3.1
  • First release: May 14, 2017
  • Latest release: Sep 2, 2020
  • Number of updates: 67
  • Update frequency: every 18.0 days
  • Top authors: redq (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

300+ active /9,305 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲1.88MB] [CPU: ▲5.96ms] Passed 4 tests

This is a short check of server-side resources used by Reuse Builder
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /5.26 ▲1.8055.54 ▲10.38
Dashboard /wp-admin5.59 ▲2.2569.45 ▲3.69
Posts /wp-admin/edit.php5.20 ▲1.8470.08 ▲15.75
Add New Post /wp-admin/post-new.php7.95 ▲2.06104.87 ▲0.58
Media Library /wp-admin/upload.php5.05 ▲1.8246.79 ▲9.17
Post Types /wp-admin/edit.php?post_type=reuseb_post_type5.1150.52
Settings /wp-admin/admin.php?page=reuse_builder_settings5.7760.43
Taxonomies /wp-admin/edit.php?post_type=reuseb_taxonomy5.1146.21
Builder /wp-admin/admin.php?page=reuse_builder5.4750.20
Templates /wp-admin/edit.php?post_type=reuseb_template5.1149.79
Term Metaboxes /wp-admin/edit.php?post_type=reuseb_term_metabox5.1150.92
Metaboxes /wp-admin/edit.php?post_type=reuseb_metabox5.1153.54

Server storage [IO: ▲64.42MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
Just a few items left to fix
  • Total filesystem usage must be limited to 25MB (currently using 64.42MB)
Filesystem: 413 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
can_compress_scripts
reactive_builder_admin_notices
webpack_public_path_url
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Reuse Builder
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,075 ▲31424.84 ▲10.281.73 ▲0.1643.44 ▲0.85
Dashboard /wp-admin2,477 ▲30015.75 ▲10.19325.70 ▲238.5045.64 ▲5.18
Posts /wp-admin/edit.php2,384 ▲2815.24 ▲3.2684.82 ▲40.2834.25 ▼13.00
Add New Post /wp-admin/post-new.php1,650 ▲11333.02 ▲14.96841.78 ▲182.0236.28 ▼31.30
Media Library /wp-admin/upload.php1,524 ▲1216.63 ▲2.42102.69 ▲4.1544.07 ▲1.93
Post Types /wp-admin/edit.php?post_type=reuseb_post_type1,3545.3775.7729.82
Settings /wp-admin/admin.php?page=reuse_builder_settings1,21819.11302.6028.51
Taxonomies /wp-admin/edit.php?post_type=reuseb_taxonomy1,3515.2382.7331.56
Builder /wp-admin/admin.php?page=reuse_builder1,13517.43203.1528.32
Templates /wp-admin/edit.php?post_type=reuseb_template1,3455.2867.7028.05
Term Metaboxes /wp-admin/edit.php?post_type=reuseb_term_metabox1,3485.2168.9529.29
Metaboxes /wp-admin/edit.php?post_type=reuseb_metabox1,3485.2268.6331.00

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 8 options
    • theysaidso_admin_options
    • can_compress_scripts
    • webpack_public_path_url
    • db_upgraded
    • widget_theysaidso_widget
    • reactive_builder_admin_notices
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/reuse-builder/admin-templates/form/condition-builder.php
  • 34× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_type() in wp-content/plugins/reuse-builder/templates/content-single-reuse-page.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/reuse-builder/admin-templates/form/metabox-builder.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_localize_script() in wp-content/plugins/reuse-builder/admin-templates/form/builder.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_type() in wp-content/plugins/reuse-builder/templates/content-archive-reuse-page.php:9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/reuse-builder/admin-templates/form/metabox-preview.php on line 16
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/reuse-builder/admin-templates/form/metabox-preview.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/reuse-builder/admin-templates/listing.php:1
    • > PHP Notice
      Undefined variable: template in wp-content/plugins/reuse-builder/admin-templates/form/metabox-preview.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'Reuse\\Builder\\Provider' not found in wp-content/plugins/reuse-builder/admin-templates/geo-metabox-preview.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_localize_script() in wp-content/plugins/reuse-builder/admin-templates/form/taxonomy-builder.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
8 plugin tags: builder, templates, term metabox, generator, taxonomy...

reuse-builder/reuse-builder.php Passed 13 tests

The principal PHP file in "Reuse Builder" v. 1.7 is loaded by WordPress automatically on each request
82 characters long description:
A Simple but powerful Post Type, Metabox, Taxonomy, Term meta and Template builder

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin38,619 lines of code in 389 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2722,8342,08712,615
CSS13972419,359
PHP596497876,017
SVG5095,878
LESS315342674,361
JSON500281
HTML1134360
XML13028
YAML15016
Markdown1204

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity12.48
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity3.41
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes25
▷ Abstract classes14.00%
▷ Concrete classes2496.00%
▷ Final classes00.00%
Methods112
▷ Static methods2118.75%
▷ Public methods11199.11%
▷ Protected methods00.00%
▷ Private methods10.89%
Functions30
▷ Named functions2170.00%
▷ Anonymous functions930.00%
Constants15
▷ Global constants1386.67%
▷ Class constants213.33%
▷ Public constants2100.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
There are no PNG files in this plugin