88% build-a-house

Code Review | Build a House

WordPress plugin Build a House scored 88% from 54 tests.

About plugin

  • Plugin page: build-a-house
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 5.8.1
  • First release: Apr 21, 2021
  • Latest release: Aug 12, 2021
  • Number of updates: 11
  • Update frequency: every 10.4 days
  • Top authors: iworks (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 199 total downloads

Benchmarks

Plugin footprint Passed 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.72MB] [CPU: ▼134.78ms] 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 /3.51 ▲0.7941.87 ▲21.76
Dashboard /wp-admin3.77 ▲0.7149.05 ▲6.97
Posts /wp-admin/edit.php3.81 ▲0.7050.20 ▲7.11
Add New Post /wp-admin/post-new.php6.18 ▲0.7592.09 ▼561.86
Media Library /wp-admin/upload.php3.70 ▲0.7040.99 ▲8.68
Configuration /wp-admin/edit.php?post_type=ibh_expence&page=iworks_build_a_house_index3.6338.99
Expences /wp-admin/edit.php?post_type=ibh_expence3.7642.45
Add New expence /wp-admin/post-new.php?post_type=ibh_expence3.8355.29
Contractors /wp-admin/edit.php?post_type=ibh_contractor3.7638.61
Events /wp-admin/edit.php?post_type=ibh_event3.7639.35
Breakdowns /wp-admin/edit-tags.php?taxonomy=iworks_build_a_house_breakdown&post_type=ibh_expence3.7035.00

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 57 new files
Database: no new tables, 1 new option
New WordPress options
iworks_build_a_house_cache_stamp

Browser metrics Passed 4 tests

Build a House: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,769 ▲16315.96 ▲0.0310.87 ▼0.6248.90 ▲2.48
Dashboard /wp-admin3,033 ▲1026.11 ▲0.14133.54 ▼16.94118.43 ▲3.80
Posts /wp-admin/edit.php2,794 ▲552.84 ▼0.0165.94 ▼3.1493.56 ▼1.90
Add New Post /wp-admin/post-new.php1,718 ▲4818.79 ▼0.34351.79 ▼35.14124.55 ▲10.77
Media Library /wp-admin/upload.php1,862 ▲555.03 ▲0.01151.07 ▼4.29118.99 ▼0.80
Configuration /wp-admin/edit.php?post_type=ibh_expence&page=iworks_build_a_house_index1,4288.99158.6073.53
Expences /wp-admin/edit.php?post_type=ibh_expence1,6428.06114.7576.80
Add New expence /wp-admin/post-new.php?post_type=ibh_expence3,34714.41281.47139.03
Contractors /wp-admin/edit.php?post_type=ibh_contractor1,6058.07112.5271.54
Events /wp-admin/edit.php?post_type=ibh_event1,6207.93113.7672.63
Breakdowns /wp-admin/edit-tags.php?taxonomy=iworks_build_a_house_breakdown&post_type=ibh_expence1,7942.5260.0981.30

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

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
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/build-a-house/assets/template-parts/block/expences-table-header.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/build-a-house/assets/template-parts/block/expences-table-body-row.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/build-a-house/assets/template-parts/block/expences-table-footer.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_site_option() in wp-content/plugins/build-a-house/vendor/iworks/rate/rate.php:89

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_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 325: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 412: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 2084:9 Uncaught SyntaxError: Unexpected token '-'
    • > GET request to /wp-admin/edit.php?post_type=ibh_contractor
    • > Javascript (severe) in unknown
    /wp-admin/edit.php?post_type=ibh_contractor 410: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 411: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: house, home, build, logger, construction

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

The main file in "Build a House" v. 1.0.2 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,330 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
PHP142948913,183
CSS104345867
JavaScript1374103603
PO File1211263446
Markdown2530125
SVG21164
JSON10042

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 189)
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity70.12
▷ Minimum class complexity9.00
▷ Maximum class complexity382.00
Average method complexity4.76
▷ Minimum method complexity1.00
▷ Maximum method complexity189.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods147
▷ Static methods10.68%
▷ Public methods10772.79%
▷ Protected methods1711.56%
▷ Private methods2315.65%
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
6 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/externals/datepicker/css/images/ui-icons_cc0000_256x240.png4.44KB4.17KB▼ 6.02%
assets/externals/datepicker/css/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%
assets/externals/datepicker/css/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
assets/externals/datepicker/css/images/ui-icons_444444_256x240.png6.83KB4.17KB▼ 38.86%
assets/externals/datepicker/css/images/ui-icons_777777_256x240.png6.83KB4.17KB▼ 38.92%