79% ry-wc-city-select

Code Review | RY WC City Select

WordPress plugin RY WC City Select scored 79% from 54 tests.

About plugin

  • Plugin page: ry-wc-city-select
  • Plugin version: 2.0.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.2
  • WordPress version: 6.3.1
  • First release: Dec 7, 2019
  • Latest release: Aug 26, 2023
  • Number of updates: 53
  • Update frequency: every 25.6 days
  • Top authors: fantasyworld (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

2,000+ active / 19,934 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
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼11.85ms] Passed 4 tests

An overview of server-side resources used by RY WC City Select
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0544.12 ▼2.35
Dashboard /wp-admin3.35 ▲0.0552.70 ▼8.71
Posts /wp-admin/edit.php3.40 ▲0.0548.38 ▼8.59
Add New Post /wp-admin/post-new.php5.93 ▲0.0590.80 ▼27.76
Media Library /wp-admin/upload.php3.27 ▲0.0441.85 ▲5.25

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for RY WC City Select
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.69 ▼0.821.98 ▲0.3842.96 ▼8.85
Dashboard /wp-admin2,209 ▲274.84 ▼1.05101.56 ▼23.2842.44 ▼6.79
Posts /wp-admin/edit.php2,092 ▼02.05 ▲0.0239.48 ▼4.1934.06 ▼18.23
Add New Post /wp-admin/post-new.php1,533 ▲1323.34 ▲0.03676.90 ▼56.8065.10 ▲4.75
Media Library /wp-admin/upload.php1,391 ▲34.19 ▲0.03108.86 ▼6.1347.47 ▼1.45

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/ry-wc-city-select/ry-wc-city-select.php
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/ry-wc-city-select/cities/KW.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ry-wc-city-select/states/TW.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/ry-wc-city-select/cities/RO.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ry-wc-city-select/states/KW.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/ry-wc-city-select/cities/TW.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: select, city, dropdown, woocommerce

ry-wc-city-select/ry-wc-city-select.php Passed 13 tests

This is the main PHP file of "RY WC City Select" version 2.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
99 characters long description:
Show a dropdown select as the cities input on WooCommerce. Auto set the postcode for selected city.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin14,949 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP7512514,780
JavaScript1277169

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity41.00
▷ Minimum class complexity41.00
▷ Maximum class complexity41.00
Average method complexity3.86
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods14
▷ Static methods321.43%
▷ Public methods1285.71%
▷ Protected methods214.29%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
PNG images were not found in this plugin