78% build-a-house

Code Review | Build a House

WordPress plugin Build a House scored78%from 54 tests.

About plugin

  • Plugin page: build-a-house
  • Plugin version: 1.0.7
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Apr 21, 2021
  • Latest release: Oct 22, 2023
  • Number of updates: 18
  • Update frequency: every 50.8 days
  • Top authors: iworks (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /767 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
Install script ran successfully

Server metrics [RAM: ▲0.74MB] [CPU: ▲3.40ms] Passed 4 tests

A check of server-side resources used by Build a House
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.22 ▲0.7543.91 ▲2.81
Dashboard /wp-admin4.04 ▲0.7452.86 ▲2.44
Posts /wp-admin/edit.php4.10 ▲0.7451.19 ▲6.06
Add New Post /wp-admin/post-new.php6.76 ▲0.8888.04 ▲2.29
Media Library /wp-admin/upload.php3.96 ▲0.7452.61 ▲15.90
Contractors /wp-admin/edit.php?post_type=ibh_contractor4.0245.37
Configuration /wp-admin/edit.php?post_type=ibh_expence&page=iworks_build_a_house_index3.8947.20
Events /wp-admin/edit.php?post_type=ibh_event4.0245.09
Expences /wp-admin/edit.php?post_type=ibh_expence4.0241.16
Breakdowns /wp-admin/edit-tags.php?taxonomy=iworks_build_a_house_breakdown&post_type=ibh_expence3.9638.22
Add New expence /wp-admin/post-new.php?post_type=ibh_expence4.1056.52

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 75 new files
Database: no new tables, 7 new options
New WordPress options
iworks_build_a_house_cache_stamp
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Build a House: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲7614.25 ▼0.151.79 ▼0.4643.07 ▼4.40
Dashboard /wp-admin2,232 ▲555.54 ▼0.0582.87 ▼15.8540.51 ▼1.72
Posts /wp-admin/edit.php2,140 ▲432.00 ▼0.0133.62 ▼2.1836.67 ▲2.34
Add New Post /wp-admin/post-new.php1,688 ▲16023.32 ▲0.22586.70 ▼90.0855.38 ▼0.55
Media Library /wp-admin/upload.php1,440 ▲464.13 ▼0.1599.30 ▲0.8543.92 ▲2.68
Contractors /wp-admin/edit.php?post_type=ibh_contractor1,2189.64171.0926.17
Configuration /wp-admin/edit.php?post_type=ibh_expence&page=iworks_build_a_house_index1,1089.8380.0234.21
Events /wp-admin/edit.php?post_type=ibh_event1,2269.7177.5926.01
Expences /wp-admin/edit.php?post_type=ibh_expence1,2469.5775.8727.67
Breakdowns /wp-admin/edit-tags.php?taxonomy=iworks_build_a_house_breakdown&post_type=ibh_expence1,3202.1225.9629.88
Add New expence /wp-admin/post-new.php?post_type=ibh_expence2,21511.27234.6466.10

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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 take a closer look at the following
  • 14× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/build-a-house/assets/template-parts/block/expences-breakdown-table-header.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/build-a-house/includes/iworks/rate/templates/widgets/support.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/build-a-house/assets/template-parts/block/expences-breakdown-table-body-row.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/build-a-house/includes/iworks/rate/templates/widgets/donate.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/build-a-house/includes/iworks/rate/templates/plugins/og.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/build-a-house/assets/template-parts/block/expences-section-table-header.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_parse_args() in wp-content/plugins/build-a-house/includes/iworks/rate/rate.php:69
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/build-a-house/assets/template-parts/block/expences-section-table-body-row.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/build-a-house/assets/template-parts/block/expences-breakdown-table-footer.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/build-a-house/includes/iworks/rate/templates/thanks.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/edit.php?post_type=ibh_contractor
    • > Javascript (severe) in unknown
    /wp-admin/edit.php?post_type=ibh_contractor 369:9 Uncaught SyntaxError: Unexpected token '-'
    • > GET request to /wp-admin/edit.php?post_type=ibh_expence&page=iworks_build_a_house_index
    • > Javascript (severe) in unknown
    /wp-admin/edit.php?post_type=ibh_expence&page=iworks_build_a_house_index 297:9 Uncaught SyntaxError: Unexpected token '-'
    • > GET request to /wp-admin/edit.php?post_type=ibh_event
    • > Javascript (severe) in unknown
    /wp-admin/edit.php?post_type=ibh_event 370:9 Uncaught SyntaxError: Unexpected token '-'
    • > GET request to /wp-admin/edit.php?post_type=ibh_expence
    • > Javascript (severe) in unknown
    /wp-admin/edit.php?post_type=ibh_expence 371:9 Uncaught SyntaxError: Unexpected token '-'
    • > GET request to /wp-admin/post-new.php?post_type=ibh_expence
    • > Javascript (severe) in unknown
    /wp-admin/post-new.php?post_type=ibh_expence 2032:9 Uncaught SyntaxError: Unexpected token '-'

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: home, logger, build, house, construction

build-a-house/build-a-house.php Passed 13 tests

The main file in "Build a House" v. 1.0.7 serves as a complement to information provided in readme.txt and as the entry point to the plugin
68 characters long description:
Build a House allows to log expenses and events during construction.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected5,819 lines of code in 55 files:
LanguageFilesBlank linesComment linesLines of code
PHP242879753,538
CSS114943846
JavaScript1365108635
PO File1220268472
Markdown2690138
Sass180138
JSON10039
SVG20013

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 192)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity72.50
▷ Minimum class complexity9.00
▷ Maximum class complexity387.00
Average method complexity4.51
▷ Minimum method complexity1.00
▷ Maximum method complexity192.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods163
▷ Static methods10.61%
▷ Public methods11872.39%
▷ Protected methods127.36%
▷ Private methods3320.25%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
12 PNG files occupy 0.07MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/externals/datepicker/css/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
includes/iworks/options/assets/styles/images/ui-icons_777777_256x240.png6.94KB4.18KB▼ 39.78%
assets/externals/datepicker/css/images/ui-icons_777777_256x240.png6.83KB4.17KB▼ 38.92%
assets/externals/datepicker/css/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%
assets/externals/datepicker/css/images/ui-icons_444444_256x240.png6.83KB4.17KB▼ 38.86%