10% realtor-express

Code Review | Realtor Express

WordPress plugin Realtor Express scored10%from 54 tests.

About plugin

  • Plugin page: realtor-express
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.5
  • WordPress version: 6.3.1
  • First release: Sep 21, 2012
  • Latest release: Dec 16, 2012
  • Number of updates: 6
  • Update frequency: every 14.3 days
  • Top authors: ty_pwd (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /3,173 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/realtor-express/includes/RexApp.php+65
    Undefined index: rex-filter

Server metrics [RAM: ▼1.87MB] [CPU: ▼52.30ms] Passed 4 tests

An overview of server-side resources used by Realtor Express
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.12 ▼1.345.01 ▼31.13
Dashboard /wp-admin2.15 ▼1.206.44 ▼54.81
Posts /wp-admin/edit.php2.15 ▼1.217.52 ▼38.38
Add New Post /wp-admin/post-new.php2.15 ▼3.7410.31 ▼84.86
Media Library /wp-admin/upload.php2.15 ▼1.085.48 ▼27.44
Add New /wp-admin/post-new.php?post_type=rex_listing2.155.33
Documentation /wp-admin/edit.php?post_type=rex_listing&page=documentation2.156.64
All Listings /wp-admin/edit.php?post_type=rex_listing2.156.12
Listing Type /wp-admin/edit-tags.php?taxonomy=rex_listing_type&post_type=rex_listing2.156.08
Listing Style /wp-admin/edit-tags.php?taxonomy=rex_listing_style&post_type=rex_listing2.155.50
Settings /wp-admin/edit.php?post_type=rex_listing&page=settings2.156.32

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 48 new files
Database: 1 new table, 12 new options
New tables
wp_rex_listings
New WordPress options
rex_floor_space_units
rex_listing_type_children
theysaidso_admin_options
rex_listing_style_children
rex_version
can_compress_scripts
widget_theysaidso_widget
widget_rex_multi_map_widget
widget_rex_listing_filter_widget
db_upgraded
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Realtor Express
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,057 ▲31115.16 ▲0.8114.05 ▲12.3143.36 ▲2.84
Dashboard /wp-admin2,293 ▲1195.70 ▲0.18106.12 ▲18.4744.94 ▲0.82
Posts /wp-admin/edit.php2,210 ▲1102.73 ▲0.7044.14 ▲2.6332.85 ▼7.55
Add New Post /wp-admin/post-new.php1,581 ▲5223.79 ▲0.73685.61 ▲29.0135.33 ▼19.90
Media Library /wp-admin/upload.php1,504 ▲1075.13 ▲0.97109.12 ▼0.1042.10 ▼5.99
Add New /wp-admin/post-new.php?post_type=rex_listing3,1058.06191.8069.89
Documentation /wp-admin/edit.php?post_type=rex_listing&page=documentation1,0392.4434.9330.86
All Listings /wp-admin/edit.php?post_type=rex_listing1,1562.6141.4931.08
Listing Type /wp-admin/edit-tags.php?taxonomy=rex_listing_type&post_type=rex_listing1,5862.4040.7733.98
Listing Style /wp-admin/edit-tags.php?taxonomy=rex_listing_style&post_type=rex_listing1,5372.4139.1332.27
Settings /wp-admin/edit.php?post_type=rex_listing&page=settings8982.3234.2226.69

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/realtor-express/includes/RexApp.php+65
    Undefined index: rex-filter
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_rex_listings
  • The uninstall procedure has failed, leaving 12 options in the database
    • widget_recent-posts
    • rex_listing_type_children
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • rex_floor_space_units
    • widget_recent-comments
    • widget_rex_listing_filter_widget
    • widget_rex_multi_map_widget
    • rex_listing_style_children
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=rex_listing&page=settings
    • > Notice in wp-content/plugins/realtor-express/includes/RexApp.php+65
    Undefined index: rex-filter
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=rex_listing&page=settings
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method RexListingController::adminPagesCallback() should not be called statically
    • > GET request to /wp-admin/post-new.php?post_type=rex_listing
    • > Deprecated in wp-includes/class-wp-hook.php+312
    Non-static method RexListingController::saveData() should not be called statically
    • > GET request to /wp-admin/post-new.php?post_type=rex_listing
    • > Notice in wp-content/plugins/realtor-express/controllers/RexListingController.php+23
    Undefined index: rex_listing_info_nonce
    • > GET request to /wp-admin/post-new.php?post_type=rex_listing
    • > Deprecated in wp-includes/class-wp-hook.php+312
    Non-static method RexListingController::addMetaBoxes() should not be called statically
    • > GET request to /wp-admin/post-new.php?post_type=rex_listing
    • > Deprecated in wp-admin/includes/template.php+1443
    Non-static method RexListingController::listingInformationCallback() should not be called statically
    • > GET request to /wp-admin/edit.php?post_type=rex_listing&page=documentation
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method RexListingController::docPageCallback() should not be called statically

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 17× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/realtor-express/views/RexSettingsView.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_ID() in wp-content/plugins/realtor-express/views/RexListingsLoopView.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/realtor-express/widgets/RexListingFilterWidget.php:6
    • > PHP Notice
      Undefined variable: locations_json_array in wp-content/plugins/realtor-express/views/RexShortcodeMultiMapView.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/realtor-express/views/RexListingContentView.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/realtor-express/views/RexAdminDocView.php:12
    • > PHP Notice
      Undefined variable: wrap_class in wp-content/plugins/realtor-express/views/RexAdminDocView.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/realtor-express/views/RexAdminListingView.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function home_url() in wp-content/plugins/realtor-express/views/RexWidgetListingFilterView.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/realtor-express/views/RexShortcodeGalleryView.php:11

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=rex_listing&page=settings
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?sensor=false&ver=6.3.1 210: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"
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=rex_listing&page=settings
    • > Network (severe)
    wp-admin/undefined/plugins/lightbox/images/loading.gif - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=rex_listing&page=settings
    • > Network (severe)
    wp-admin/undefined/plugins/lightbox/images/close.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: Add images for these screenshots: #1 (Listings Management), #2 (Single Listing Details), #3 (Listings View), #4 (Multi Map)
You can look at the official readme.txt

realtor-express/realtor.php 92% from 13 tests

The entry point to "Realtor Express" version 1.0.4 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("realtor-express.php" instead of "realtor.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin2,829 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP222664631,422
CSS484169905
JavaScript583115502

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity14.44
▷ Minimum class complexity1.00
▷ Maximum class complexity61.00
Average method complexity2.81
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods67
▷ Static methods3958.21%
▷ Public methods6698.51%
▷ Protected methods00.00%
▷ Private methods11.49%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
10 PNG files occupy 1.20MB with 0.53MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
plugins/lightbox/images/bg-checker.png0.93KB0.09KB▼ 90.00%
screenshot-2.png216.27KB78.79KB▼ 63.57%
plugins/lightbox/images/prev.png1.34KB1.59KB0.00%
screenshot-3.png163.21KB54.62KB▼ 66.53%
plugins/lightbox/images/next.png1.33KB1.58KB0.00%