10% realtyphp

Code Review | RealtyPHP-WP

WordPress plugin RealtyPHP-WP scored10%from 54 tests.

About plugin

  • Plugin page: realtyphp
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.5
  • WordPress version: 6.3.1
  • First release: Dec 19, 2012
  • Latest release: Apr 11, 2013
  • Number of updates: 19
  • Update frequency: every 6.0 days
  • Top authors: horvelod (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,728 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/realtyphp/lib/Realtyphp_installer.php+246
    Use of undefined constant WPLANG - assumed 'WPLANG' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.41MB] [CPU: ▼42.52ms] Passed 4 tests

Server-side resources used by RealtyPHP-WP
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.58 ▼35.26
Dashboard /wp-admin2.78 ▼0.5314.51 ▼29.39
Posts /wp-admin/edit.php2.78 ▼0.5815.59 ▼26.39
Add New Post /wp-admin/post-new.php2.78 ▼3.1116.12 ▼79.05
Media Library /wp-admin/upload.php2.78 ▼0.4515.03 ▼15.23
Add new /wp-admin/admin.php?page=realtyphp_listings&action=create2.7815.22
Settings /wp-admin/admin.php?page=realtyphp_settings&action=index2.7817.76
/wp-admin/admin.php?page=Realtyphp_admin_home2.7814.48
All listings /wp-admin/admin.php?page=realtyphp_listings&action=index2.7816.50
RealtyPHP /wp-admin/admin.php?page=realtyphp_admin_home2.7814.09

Server storage [IO: ▲1.02MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 87 new files
Database: 6 new tables, 6 new options
New tables
wp_realtyphp_countries
wp_realtyphp_listings_pictures
wp_realtyphp_offer
wp_realtyphp_listings
wp_realtyphp_state_province
wp_realtyphp_property_types
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for RealtyPHP-WP
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,992 ▲25713.91 ▼0.507.16 ▲5.5436.60 ▼4.28
Dashboard /wp-admin2,267 ▲785.24 ▲0.29102.71 ▼29.3741.97 ▼3.46
Posts /wp-admin/edit.php2,156 ▲642.32 ▲0.2641.77 ▲6.1234.60 ▲5.56
Add New Post /wp-admin/post-new.php1,559 ▲2417.69 ▼5.69617.22 ▼0.9235.74 ▼23.25
Media Library /wp-admin/upload.php1,455 ▲644.56 ▲0.3597.17 ▼4.5742.36 ▼0.69
Add new /wp-admin/admin.php?page=realtyphp_listings&action=create1,9306.99143.9260.68
Settings /wp-admin/admin.php?page=realtyphp_settings&action=index8401.8428.3623.77
/wp-admin/admin.php?page=Realtyphp_admin_home8761.8429.3625.39
All listings /wp-admin/admin.php?page=realtyphp_listings&action=index1,0891.8827.9830.16
RealtyPHP /wp-admin/admin.php?page=realtyphp_admin_home8791.9129.5727.42

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/realtyphp/lib/Bootstrap.php+114
    Use of undefined constant WPLANG - assumed 'WPLANG' (this will throw an Error in a future version of PHP)
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

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
These errors were triggered by the plugin
  • 41 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=realtyphp_admin_home
    • > Warning in wp-content/plugins/realtyphp/application/views/realtyphp_admin_home/index.php+39
    Use of undefined constant WPLANG - assumed 'WPLANG' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/admin.php?page=realtyphp_listings&action=create
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method Realtyphp_listings::create() should not be called statically
    • > GET request to /wp-admin/admin.php?page=realtyphp_settings&action=index
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method Realtyphp_settings::index() should not be called statically
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=realtyphp_admin_home
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method Realtyphp_admin_home::index() should not be called statically
    • > GET request to /wp-admin/admin.php?page=realtyphp_listings&action=index
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method Realtyphp_listings::index() should not be called statically

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 18× 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 _e() in wp-content/plugins/realtyphp/application/views/realtyphp_admin_home/index.php:3
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/realtyphp/application/views/realtyphp_settings/a_stpr.php on line 1
    • > PHP Notice
      Undefined variable: photos in wp-content/plugins/realtyphp/application/views/realtyphp_listings/a_uploaded_photos.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/realtyphp/lib/All_Listings_Admin.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/realtyphp/application/views/realtyphp_listings/update.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/realtyphp/realtyphp.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/realtyphp/application/views/realtyphp_listings/a_stpr.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/realtyphp/application/views/realtyphp_settings/index.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/realtyphp/application/views/realtyphp_settings/countries.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/realtyphp/application/views/realtyphp_settings/property_types.php:6

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
These are user-side errors you should fix
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=realtyphp_admin_home
    • > Network (severe)
    wp-content/plugins/realtyphp/js/WPLANG/validate_messages_WPLANG.js?ver=6.3.1 - 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/admin.php?page=realtyphp_admin_home
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/realtyphp/js/en_US/realtyphp-en_US-backend.js?ver=6.3.1:49:22)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=realtyphp_admin_home
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (You can see on the screenshot-1.png the frontend listings page.), #2 (On the screenshot-2.png you can see the page of an item.)
Please take inspiration from this readme.txt

realtyphp/realtyphp.php Passed 13 tests

"RealtyPHP-WP" version 1.0.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
41 characters long description:
Real Estate listing plugin for Wordpress.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected9,937 lines of code in 78 files:
LanguageFilesBlank linesComment linesLines of code
PHP611,3594,1576,596
JavaScript143685732,801
CSS2341360
PO File186128180

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 516)
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity46.25
▷ Minimum class complexity1.00
▷ Maximum class complexity728.00
Average method complexity7.80
▷ Minimum method complexity1.00
▷ Maximum method complexity516.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes00.00%
Methods133
▷ Static methods3828.57%
▷ Public methods13198.50%
▷ Protected methods00.00%
▷ Private methods21.50%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants35
▷ Global constants35100.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
3 PNG files occupy 0.19MB with 0.12MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/galleria/classic-map.png1.80KB0.67KB▼ 62.77%
screenshot-1.png57.51KB23.67KB▼ 58.84%
screenshot-2.png136.47KB53.05KB▼ 61.13%