93% contempo-real-estate-custom-posts

Code Review | Contempo Real Estate Custom Posts

WordPress plugin Contempo Real Estate Custom Posts scored 93% from 54 tests.

About plugin

  • Plugin page: contempo-real-est...
  • Plugin version: 3.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.9
  • WordPress version: 5.9.2
  • First release: Aug 21, 2015
  • Latest release: Mar 23, 2022
  • Number of updates: 310
  • Update frequency: every 7.8 days
  • Top authors: contempoinc (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

4,000+ active / 185,135 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲1.84MB] [CPU: ▼289.96ms] Passed 4 tests

Analyzing server-side resources used by Contempo Real Estate Custom Posts
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /5.06 ▲1.5458.55 ▲8.71
Dashboard /wp-admin5.33 ▲1.9247.88 ▲9.75
Posts /wp-admin/edit.php5.59 ▲1.9551.10 ▲11.09
Add New Post /wp-admin/post-new.php9.00 ▲2.03102.00 ▼1,188.78
Media Library /wp-admin/upload.php5.26 ▲1.9635.53 ▲10.50
Zipcode /wp-admin/edit-tags.php?taxonomy=zipcode&post_type=listings5.4137.19
Add New /wp-admin/post-new.php?post_type=testimonial5.6559.36
Listings /wp-admin/edit.php?post_type=listings5.3340.12
County /wp-admin/edit-tags.php?taxonomy=county&post_type=listings5.4136.08
Country /wp-admin/edit-tags.php?taxonomy=country&post_type=listings5.4138.16
Additional Features /wp-admin/edit-tags.php?taxonomy=additional_features&post_type=listings5.4136.99
Testimonials /wp-admin/edit.php?post_type=testimonial5.3438.29
City /wp-admin/edit-tags.php?taxonomy=city&post_type=listings5.4137.27
Brokerages /wp-admin/edit.php?post_type=brokerage5.3438.38
State /wp-admin/edit-tags.php?taxonomy=state&post_type=listings5.4137.68

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 571 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Contempo Real Estate Custom Posts
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,260 ▲53418.08 ▲2.396.69 ▲0.602.47 ▼0.29
Dashboard /wp-admin3,347 ▲4938.10 ▲1.90141.00 ▲7.60203.67 ▲43.72
Posts /wp-admin/edit.php3,174 ▲4834.80 ▲1.5686.08 ▲22.81174.34 ▲31.12
Add New Post /wp-admin/post-new.php2,401 ▲64923.64 ▲2.57431.32 ▼22.51240.36 ▲82.77
Media Library /wp-admin/upload.php1,959 ▲2615.73 ▲0.19114.05 ▼31.67227.47 ▲45.15
Zipcode /wp-admin/edit-tags.php?taxonomy=zipcode&post_type=listings2,0745.1282.39164.65
Add New /wp-admin/post-new.php?post_type=testimonial3,49710.07213.04255.17
Listings /wp-admin/edit.php?post_type=listings1,9534.7779.04144.49
County /wp-admin/edit-tags.php?taxonomy=county&post_type=listings2,0795.0180.79151.96
Country /wp-admin/edit-tags.php?taxonomy=country&post_type=listings2,0785.1177.72145.92
Additional Features /wp-admin/edit-tags.php?taxonomy=additional_features&post_type=listings2,0794.9587.37155.01
Testimonials /wp-admin/edit.php?post_type=testimonial1,9275.2477.49150.51
City /wp-admin/edit-tags.php?taxonomy=city&post_type=listings2,0735.0774.70150.66
Brokerages /wp-admin/edit.php?post_type=brokerage1,8905.3680.90157.69
State /wp-admin/edit-tags.php?taxonomy=state&post_type=listings2,0745.1177.07144.68

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
  • 72× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/contempo-real-estate-custom-posts/includes/metabox/init.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Radio' not found in wp-content/plugins/contempo-real-estate-custom-posts/cmb2/includes/types/CMB2_Type_Taxonomy_Radio_Hierarchical.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/contempo-real-estate-custom-posts/cmb2/includes/types/CMB2_Type_File_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/contempo-real-estate-custom-posts/includes/widgets/ct-widget-listings.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/contempo-real-estate-custom-posts/includes/ct-real-estate-custom-shortcodes.php:794
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/contempo-real-estate-custom-posts/cmb2/includes/types/CMB2_Type_Textarea.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/contempo-real-estate-custom-posts/includes/widgets/ct-widget-agentinfo.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/contempo-real-estate-custom-posts/cmb2/includes/types/CMB2_Type_Wysiwyg.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller_Boxes' not found in wp-content/plugins/contempo-real-estate-custom-posts/cmb2/includes/rest-api/CMB2_REST_Controller_Fields.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller' not found in wp-content/plugins/contempo-real-estate-custom-posts/cmb2/includes/rest-api/CMB2_REST_Controller_Boxes.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Donate link: Invalid URI found ("")
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
Please take inspiration from this readme.txt

contempo-real-estate-custom-posts/ct-real-estate-custom-posts.php 85% from 13 tests

The main PHP file in "Contempo Real Estate Custom Posts" ver. 3.2.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("contempo-real-estate-custom-posts.php" instead of "ct-real-estate-custom-posts.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected141,428 lines of code in 359 files:
LanguageFilesBlank linesComment linesLines of code
PO File16143,57085,82895,359
PHP1496,44211,82733,557
CSS171,2451,2716,890
JavaScript146859533,826
Sass16300251,379
SVG100399
XML10018

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
It is recommended to fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 164)
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity24.54
▷ Minimum class complexity1.00
▷ Maximum class complexity181.00
Average method complexity4.24
▷ Minimum method complexity1.00
▷ Maximum method complexity164.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes142
▷ Abstract classes85.63%
▷ Concrete classes13494.37%
▷ Final classes21.49%
Methods1,035
▷ Static methods13112.66%
▷ Public methods84481.55%
▷ Protected methods18517.87%
▷ Private methods60.58%
Functions140
▷ Named functions140100.00%
▷ Anonymous functions00.00%
Constants18
▷ Global constants422.22%
▷ Class constants1477.78%
▷ Public constants14100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
28 compressed PNG files occupy 0.05MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/metabox/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
includes/metabox/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
includes/metabox/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
cmb2/images/ico-delete.png0.70KB0.72KB0.00%
cmb2/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%