78% terraclassifieds

Code Review | TerraClassifieds - Simple Classifieds Plugin

WordPress plugin TerraClassifieds - Simple Classifieds Plugin scored78%from 54 tests.

About plugin

  • Plugin page: terraclassifieds
  • Plugin version: 2.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.9.1
  • WordPress version: 6.3.1
  • First release: May 17, 2019
  • Latest release: Mar 6, 2022
  • Number of updates: 46
  • Update frequency: every 22.3 days
  • Top authors: pixelemu (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

300+ active /17,108 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.51MB] [CPU: ▲7.62ms] Passed 4 tests

Analyzing server-side resources used by TerraClassifieds - Simple Classifieds Plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.3539.93 ▲3.43
Dashboard /wp-admin3.86 ▲0.5661.87 ▲16.04
Posts /wp-admin/edit.php3.95 ▲0.5956.61 ▲8.91
Add New Post /wp-admin/post-new.php6.47 ▲0.5899.01 ▲6.12
Media Library /wp-admin/upload.php3.78 ▲0.5546.53 ▲12.02
Add New /wp-admin/post-new.php?post_type=classified4.3672.48
Categories /wp-admin/edit-tags.php?taxonomy=ad_category&post_type=classified3.8952.45
Types /wp-admin/edit-tags.php?taxonomy=ad_type&post_type=classified3.8446.28
Locations /wp-admin/edit-tags.php?taxonomy=ad_location&post_type=classified3.7845.55
Settings /wp-admin/edit.php?post_type=classified&page=terraclassifieds_settings5.2760.46
Ads /wp-admin/edit.php?post_type=classified3.8047.01

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 799 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
widget_terraclassifiedssearch
widget_recent-comments
can_compress_scripts
widget_terraclassifiedscategories
widget_recent-posts
widget_terraclassifiedslatestads
theysaidso_admin_options
widget_terraclassifiedsmenu
db_upgraded

Browser metrics Passed 4 tests

TerraClassifieds - Simple Classifieds Plugin: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,076 ▲31914.42 ▲0.1218.24 ▲16.2439.12 ▼3.00
Dashboard /wp-admin2,267 ▲795.11 ▲0.25104.61 ▼18.0892.47 ▲47.98
Posts /wp-admin/edit.php2,164 ▲722.31 ▲0.2635.08 ▼4.5934.67 ▲0.21
Add New Post /wp-admin/post-new.php1,573 ▲3917.73 ▼5.37708.86 ▲43.8640.50 ▼15.89
Media Library /wp-admin/upload.php1,464 ▲764.51 ▲0.27104.69 ▲5.2347.98 ▲5.44
Add New /wp-admin/post-new.php?post_type=classified2,8638.32200.07136.08
Categories /wp-admin/edit-tags.php?taxonomy=ad_category&post_type=classified1,6283.6048.0579.10
Types /wp-admin/edit-tags.php?taxonomy=ad_type&post_type=classified1,8313.2060.5033.89
Locations /wp-admin/edit-tags.php?taxonomy=ad_location&post_type=classified1,3462.0232.3330.02
Settings /wp-admin/edit.php?post_type=classified&page=terraclassifieds_settings7,4016.88136.37138.02
Ads /wp-admin/edit.php?post_type=classified1,1452.2232.7328.93

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 10 options
    • widget_terraclassifiedslatestads
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_terraclassifiedsmenu
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_terraclassifiedscategories
    • widget_terraclassifiedssearch

Smoke tests 50% 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/terraclassifieds/inc/user/add-role.php
    • > /wp-content/plugins/terraclassifieds/inc/user/user.php
    • > /wp-content/plugins/terraclassifieds/inc/user/remove-role.php
    • > /wp-content/plugins/terraclassifieds/terraclassifieds.php
  • 113× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_hookup' not found in wp-content/plugins/terraclassifieds/inc/cmb2/includes/CMB2_Options_Hookup.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function terraclassifieds_get_option() in wp-content/plugins/terraclassifieds/inc/security.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/terraclassifieds/inc/cmb2/cmb2/includes/types/CMB2_Type_Multi_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/terraclassifieds/inc/cmb2/cmb2/includes/types/CMB2_Type_Taxonomy_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/terraclassifieds/inc/functions/layout.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/terraclassifieds/inc/cmb2/includes/types/CMB2_Type_Taxonomy_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller_Boxes' not found in wp-content/plugins/terraclassifieds/inc/cmb2/cmb2/includes/rest-api/CMB2_REST_Controller_Fields.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/terraclassifieds/inc/cmb2/cmb2/includes/CMB2_Field.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/terraclassifieds/inc/cmb2/cmb2/includes/types/CMB2_Type_Taxonomy_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/terraclassifieds/inc/cmb2/cmb2/includes/types/CMB2_Type_Text.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 96% from 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
4 plugin tags: classified ads, advertising, classifieds, classifieds plugin

terraclassifieds/terraclassifieds.php 92% from 13 tests

The main file in "TerraClassifieds - Simple Classifieds Plugin" v. 2.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 156 characters long)

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
There were no executable files found in this plugin113,593 lines of code in 482 files:
LanguageFilesBlank linesComment linesLines of code
PO File24128,88637,49265,989
PHP1595,62013,20222,662
CSS342,9742,39414,240
SVG4004,112
JavaScript217841,0533,753
Markdown743601,463
Sass16300251,374

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
These items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 212)
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity18.51
▷ Minimum class complexity1.00
▷ Maximum class complexity217.00
Average method complexity3.45
▷ Minimum method complexity1.00
▷ Maximum method complexity212.00
Code structure
Namespaces4
Interfaces1
Traits0
Classes159
▷ Abstract classes1610.06%
▷ Concrete classes14389.94%
▷ Final classes00.00%
Methods1,152
▷ Static methods17415.10%
▷ Public methods96583.77%
▷ Protected methods17915.54%
▷ Private methods80.69%
Functions180
▷ Named functions17798.33%
▷ Anonymous functions31.67%
Constants33
▷ Global constants1236.36%
▷ Class constants2163.64%
▷ Public constants21100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
37 compressed PNG files occupy 0.33MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/cmb2/cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
inc/cmb2/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
inc/cmb2/cmb2/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
inc/cmb2/cmb2/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
inc/cmb2/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%