68% cc-travel

Code Review | CC Travel

WordPress plugin CC Travel scored68%from 54 tests.

About plugin

  • Plugin page: cc-travel
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.2
  • WordPress version: 6.3.1
  • First release: Sep 27, 2019
  • Latest release: Oct 10, 2019
  • Number of updates: 6
  • Update frequency: every 2.2 days
  • Top authors: cuongma111 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,066 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.46MB] [CPU: ▼37.04ms] Passed 4 tests

An overview of server-side resources used by CC Travel
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0519.29 ▼19.53
Dashboard /wp-admin3.56 ▲0.2528.20 ▼20.25
Posts /wp-admin/edit.php3.56 ▲0.2024.10 ▼25.43
Add New Post /wp-admin/post-new.php3.56 ▼2.3322.78 ▼81.88
Media Library /wp-admin/upload.php3.56 ▲0.3330.62 ▼20.61
Tour /wp-admin/edit.php?post_type=cc_tour3.5632.48
Booking /wp-admin/edit.php?post_type=cc_booking3.5626.88
Travel Style /wp-admin/edit-tags.php?taxonomy=cc_travel_style&post_type=cc_tour3.5623.72
Destination /wp-admin/edit-tags.php?taxonomy=cc_destination&post_type=cc_tour3.5621.42
Add Tour /wp-admin/post-new.php?post_type=cc_tour3.5623.39
Add Booking /wp-admin/post-new.php?post_type=cc_booking3.5632.59

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 154 new files
Database: no new tables, 11 new options
New WordPress options
theysaidso_admin_options
widget_cc_travel_widget_filter_by_departure_date
widget_cc_travel_widget_filter_by_price
can_compress_scripts
widget_cc_travel_widget_filter_by_duration
db_upgraded
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
_cc_travel_options
...

Browser metrics Passed 4 tests

An overview of browser requirements for CC Travel
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,273 ▲52716.56 ▲2.3815.01 ▲13.2837.00 ▼9.56
Dashboard /wp-admin2,490 ▲2997.45 ▲2.60133.46 ▲22.6043.30 ▼0.19
Posts /wp-admin/edit.php2,396 ▲3103.74 ▲1.7355.78 ▲21.2741.32 ▲7.26
Add New Post /wp-admin/post-new.php1,651 ▲11822.52 ▼0.58656.84 ▲22.7840.96 ▼9.53
Media Library /wp-admin/upload.php1,526 ▲1355.04 ▲0.8786.62 ▼11.5843.29 ▲1.09
Tour /wp-admin/edit.php?post_type=cc_tour1,4073.6958.2929.88
Booking /wp-admin/edit.php?post_type=cc_booking1,3603.7752.6728.63
Travel Style /wp-admin/edit-tags.php?taxonomy=cc_travel_style&post_type=cc_tour1,5763.5551.8130.45
Destination /wp-admin/edit-tags.php?taxonomy=cc_destination&post_type=cc_tour1,9234.0970.6337.87
Add Tour /wp-admin/post-new.php?post_type=cc_tour4,7059.42223.2575.73
Add Booking /wp-admin/post-new.php?post_type=cc_booking1,8984.6481.6232.34

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5453
    Function get_page_by_title is deprecated since version 6.2.0! Use WP_Query instead.
  • The uninstall procedure has failed, leaving 11 options in the database
    • widget_cc_travel_widget_filter_by_departure_date
    • widget_recent-comments
    • widget_cc_travel_widget_filter_by_price
    • db_upgraded
    • theysaidso_admin_options
    • widget_cc_travel_widget_filter_by_duration
    • widget_recent-posts
    • _cc_travel_options
    • widget_theysaidso_widget
    • widget_cc_travel_widget_filter_by_taxonomy
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 40 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=cc_booking
    • > User deprecated in wp-includes/functions.php+5453
    Function get_page_by_title is deprecated since version 6.2.0! Use WP_Query instead.
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=cc_booking
    • > Notice in wp-content/plugins/cc-travel/lib/ccfw/classes/metabox.class.php+73
    Trying to access array offset on value of type bool

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
The following issues need your attention
  • 30× 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 get_post_meta() in wp-content/plugins/cc-travel/templates/single/parts/banner.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'CCFramework_Metabox' not found in wp-content/plugins/cc-travel/inc/class/metabox.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'CC_Travel_Template' not found in wp-content/plugins/cc-travel/templates/content-single-tour.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/cc-travel/inc/config/metabox.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_permalink() in wp-content/plugins/cc-travel/templates/single/parts/title.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cc_travel_get_tour_details() in wp-content/plugins/cc-travel/templates/single/parts/location.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'CCFramework_Widget' not found in wp-content/plugins/cc-travel/widgets/filter-by-duration.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cc_travel_tour_price_html() in wp-content/plugins/cc-travel/templates/single/parts/price.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cc_travel_vc_shortcode_movie_default_params() in wp-content/plugins/cc-travel/shortcodes/tour-list/config.vc.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/cc-travel/templates/single/parts/plan.php:11

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 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Screenshots: No descriptions were found for these screenshots #2, #3, #4, #5 in cc-travel/assets to your readme.txt
Please take inspiration from this readme.txt

cc-travel/cc-travel.php Passed 13 tests

Analyzing the main PHP file in "CC Travel" version 1.0.0
17 characters long description:
Plugin for travel

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin38,414 lines of code in 130 files:
LanguageFilesBlank linesComment linesLines of code
JSON20013,773
JavaScript182,3771,0369,699
CSS135051288,702
PHP951,6591,4685,542
SVG210698

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity11.79
▷ Minimum class complexity1.00
▷ Maximum class complexity97.00
Average method complexity4.60
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes48
▷ Abstract classes24.17%
▷ Concrete classes4695.83%
▷ Final classes00.00%
Methods144
▷ Static methods149.72%
▷ Public methods14097.22%
▷ Protected methods42.78%
▷ Private methods00.00%
Functions83
▷ Named functions83100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/ccfw/assets/images/checkerboard.png2.29KB2.54KB0.00%
lib/ccfw/assets/images/chosen-sprite.png0.53KB0.88KB0.00%
assets/images/config/grid-2.png2.94KB0.16KB▼ 94.73%
lib/ccfw/assets/images/chosen-sprite@2x.png0.72KB0.83KB0.00%
assets/images/config/grid-1.png2.90KB0.15KB▼ 94.99%