62% propertyhive

Code Review | PropertyHive

WordPress plugin PropertyHive scored62%from 54 tests.

About plugin

  • Plugin page: propertyhive
  • Plugin version: 2.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.4.1
  • WordPress version: 6.3.1
  • First release: Nov 30, 2015
  • Latest release: Nov 30, 2023
  • Number of updates: 449
  • Update frequency: every 6.8 days
  • Top authors: PropertyHive (100%)

Code review

54 tests

User reviews

78 reviews

Install metrics

3,000+ active /120,877 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
Installer ran successfully

Server metrics [RAM: ▲3.33MB] [CPU: ▲21.79ms] Passed 4 tests

An overview of server-side resources used by PropertyHive
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /5.72 ▲2.2654.44 ▲15.05
Dashboard /wp-admin7.00 ▲3.7075.55 ▲19.63
Posts /wp-admin/edit.php7.08 ▲3.7282.98 ▲37.20
Add New Post /wp-admin/post-new.php9.80 ▲3.91109.67 ▲15.78
Media Library /wp-admin/upload.php6.86 ▲3.6468.27 ▲36.69
Management /wp-admin/edit.php?post_type=key_date&orderby=date_due&order=asc&status=upcoming_and_overdue&filter_action=Filter7.0676.69
Enquiries /wp-admin/edit.php?post_type=enquiry7.0573.80
Merge Duplicate Contacts /wp-admin/admin.php?page=ph-merge-duplicate-contacts7.0863.48
Third Party Contacts /wp-admin/edit.php?post_type=contact&_contact_type=thirdparty7.0564.59
Viewings /wp-admin/edit.php?post_type=viewing7.0670.44
Tenancies /wp-admin/edit.php?post_type=tenancy6.9562.62
Appraisals /wp-admin/edit.php?post_type=appraisal7.0566.86
Property Hive /wp-admin/admin.php?page=propertyhive8.0765.21
Properties /wp-admin/edit.php?post_type=property7.0771.89
Owners & Landlords /wp-admin/edit.php?post_type=contact&_contact_type=owner7.0564.46

Server storage [IO: ▲8.99MB] [DB: ▲0.18MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 529 new files
Database: 2 new tables, 30 new options
New tables
wp_ph_email_log
wp_ph_address_keyword_polygon
New WordPress options
propertyhive_key_date_type
can_compress_scripts
widget_recent-comments
property_type_children
propertyhivemeta_box_errors
propertyhive_availability_departments
commercial_property_type_children
propertyhive_primary_department
propertyhive_active_departments_sales
tenure_children
...

Browser metrics Passed 4 tests

Checking browser requirements for PropertyHive
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,188 ▲44113.57 ▼0.709.30 ▲7.6437.33 ▼7.21
Dashboard /wp-admin2,560 ▲3805.82 ▲0.16120.93 ▲23.1681.08 ▲34.29
Posts /wp-admin/edit.php2,248 ▲1482.20 ▲0.2638.78 ▲1.3835.33 ▼1.00
Add New Post /wp-admin/post-new.php1,644 ▲11823.12 ▼0.54761.64 ▲121.0462.43 ▲12.77
Media Library /wp-admin/upload.php1,545 ▲1424.15 ▼0.0598.04 ▼2.2076.95 ▲35.08
Management /wp-admin/edit.php?post_type=key_date&orderby=date_due&order=asc&status=upcoming_and_overdue&filter_action=Filter1,4894.28101.2330.95
Enquiries /wp-admin/edit.php?post_type=enquiry1,5194.3291.6780.49
Merge Duplicate Contacts /wp-admin/admin.php?page=ph-merge-duplicate-contacts1,1524.0154.4967.31
Third Party Contacts /wp-admin/edit.php?post_type=contact&_contact_type=thirdparty1,4484.2162.3381.06
Viewings /wp-admin/edit.php?post_type=viewing1,6184.6874.7032.46
Tenancies /wp-admin/edit.php?post_type=tenancy1,3082.0935.8531.02
Appraisals /wp-admin/edit.php?post_type=appraisal1,5954.6366.9769.53
Property Hive /wp-admin/admin.php?page=propertyhive1,2381.8327.3328.42
Properties /wp-admin/edit.php?post_type=property1,5794.2161.3468.64
Owners & Landlords /wp-admin/edit.php?post_type=contact&_contact_type=owner1,4514.1967.4646.69

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie tables were found after uninstall: 2 tables
    • wp_ph_address_keyword_polygon
    • wp_ph_email_log
  • Zombie WordPress options were found after uninstall: 30 options
    • management_key_date_type_children
    • furnished_children
    • propertyhive_default_country
    • propertyhive_active_departments_sales
    • widget_recent-comments
    • db_upgraded
    • propertyhivemeta_box_errors
    • can_compress_scripts
    • parking_children
    • propertyhive_version
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/propertyhive/templates/search/loop-end.php
    • > /wp-content/plugins/propertyhive/includes/admin/class-ph-admin-merge-contacts.php
    • > /wp-content/plugins/propertyhive/templates/search/loop-start.php
    • > /wp-content/plugins/propertyhive/includes/admin/views/html-admin-reports-property-stock-analysis.php
    • > /wp-content/plugins/propertyhive/includes/admin/class-ph-admin-applicant-list.php
  • 95× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: post_id in wp-content/plugins/propertyhive/includes/admin/views/html-property-sales-meta-box.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/propertyhive/includes/elementor-widgets/property-full-description.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/propertyhive/includes/elementor-widgets/property-availability.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/propertyhive/includes/elementor-widgets/property-address-name-number.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/propertyhive/includes/elementor-widgets/property-search-form.php:7
    • > PHP Notice
      Undefined variable: post_id in wp-content/plugins/propertyhive/includes/admin/views/html-property-offers-meta-box.php on line 5
    • > PHP Notice
      Undefined variable: property in wp-content/plugins/propertyhive/templates/emails/applicant-match-property.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/propertyhive/includes/elementor-widgets/property-let-available-date.php:7
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/propertyhive/includes/admin/views/html-display-notes.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/propertyhive/includes/admin/views/html-property-offers-meta-box.php:26

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=contact&_contact_type=owner
    • > Console-api (warning) in unknown
    http://maps.googleapis.com/maps/api/js?ver=3 215:51 "Google Maps JavaScript API has been loaded directly without a callback. This is not supported and can lead to race conditions and suboptimal performance. For supported loading patterns please see https://goo.gle/js-api-loading"

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Tags: You are using too many tags: 24 tag instead of maximum 10
The official readme.txt might help

propertyhive/propertyhive.php 92% from 13 tests

The main file in "PropertyHive" v. 2.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/i18n/languages/")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin98,546 lines of code in 443 files:
LanguageFilesBlank linesComment linesLines of code
PHP38214,95010,08666,310
JavaScript448,1428,59428,592
CSS112251192,837
SVG200539
Markdown1680140
HTML13076
JSON20052

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 180)
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity27.81
▷ Minimum class complexity1.00
▷ Maximum class complexity710.00
Average method complexity5.51
▷ Minimum method complexity1.00
▷ Maximum method complexity180.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes288
▷ Abstract classes00.00%
▷ Concrete classes288100.00%
▷ Final classes10.35%
Methods1,692
▷ Static methods23914.13%
▷ Public methods1,49188.12%
▷ Protected methods1086.38%
▷ Private methods935.50%
Functions119
▷ Named functions11495.80%
▷ Anonymous functions54.20%
Constants21
▷ Global constants942.86%
▷ Class constants1257.14%
▷ Public constants12100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
49 PNG files occupy 0.43MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/jquery-ui/images/ui-icons_555555_256x240.png6.91KB4.18KB▼ 39.47%
assets/images/attachment-delete.png0.46KB0.36KB▼ 21.28%
assets/css/jquery-ui/images/ui-icons_cd0a0a_256x240.png4.44KB4.17KB▼ 6.02%
assets/images/chosen-sprite@2x.png0.85KB0.83KB▼ 2.99%
assets/images/admin/get-involved/trello.png78.88KB30.35KB▼ 61.53%