87% our-services-showcase

Code Review | Our Services Showcase

WordPress plugin Our Services Showcase scored 87% from 54 tests.

About plugin

  • Plugin page: our-services-show...
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.3.1
  • WordPress version: 5.9.2
  • First release: Feb 8, 2015
  • Latest release: Nov 4, 2015
  • Number of updates: 15
  • Update frequency: every 18.0 days
  • Top authors: smartcat (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

300+ active / 21,224 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▼293.84ms] Passed 4 tests

Server-side resources used by Our Services Showcase
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.1857.33 ▲7.94
Dashboard /wp-admin3.65 ▲0.2437.93 ▲6.17
Posts /wp-admin/edit.php3.86 ▲0.2243.40 ▲8.00
Add New Post /wp-admin/post-new.php7.12 ▲0.1596.56 ▼1,190.48
Media Library /wp-admin/upload.php3.53 ▲0.2328.90 ▲1.00
Settings /wp-admin/edit.php?post_type=service&page=smartcat_services_settings3.5530.76
Groups /wp-admin/edit-tags.php?taxonomy=service_position&post_type=service3.5333.37
Re-Order Services /wp-admin/edit.php?post_type=service&page=smartcat_services_reorder3.5231.54
Add New /wp-admin/post-new.php?post_type=service3.9056.58
All Services /wp-admin/edit.php?post_type=service3.6134.87

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 50 new files
Database: no new tables, 1 new option
New WordPress options
smartcat_services_options

Browser metrics Passed 4 tests

An overview of browser requirements for Our Services Showcase
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,982 ▲22816.71 ▲1.0311.21 ▲5.122.06 ▼0.88
Dashboard /wp-admin2,945 ▲916.19 ▲0.05118.88 ▼12.42174.99 ▲20.08
Posts /wp-admin/edit.php2,748 ▲543.27 ▲0.0364.35 ▲0.28143.75 ▲0.58
Add New Post /wp-admin/post-new.php1,672 ▼3921.66 ▲0.90398.80 ▼40.84169.27 ▲6.04
Media Library /wp-admin/upload.php1,754 ▲565.58 ▲0.05124.20 ▼19.63205.77 ▲6.60
Settings /wp-admin/edit.php?post_type=service&page=smartcat_services_settings1,8672.7557.22154.62
Groups /wp-admin/edit-tags.php?taxonomy=service_position&post_type=service1,6722.7957.98110.64
Re-Order Services /wp-admin/edit.php?post_type=service&page=smartcat_services_reorder1,3202.7754.62126.29
Add New /wp-admin/post-new.php?post_type=service5,66110.64215.81294.17
All Services /wp-admin/edit.php?post_type=service1,4243.2059.42111.18

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 11× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/our-services-showcase/admin/reorder.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/our-services-showcase/inc/template/icons.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/our-services-showcase/admin/setting.php:90
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/our-services-showcase/inc/template/slide.php:7
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/our-services-showcase/inc/template/quad.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/our-services-showcase/inc/class/class.smartcat-services.php:10
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/our-services-showcase/inc/template/zoomOut.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/our-services-showcase/admin/setting.php:90
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/our-services-showcase/inc/template/widget.php:14
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/our-services-showcase/inc/template/columns.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There are user-side issues you should fix
    • > GET request to /wp-admin/edit.php?post_type=service&page=smartcat_services_reorder
    • > Network (severe)
    var/www/wordpress/wp-content/plugins/our-services-showcase/img/check.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=service&page=smartcat_services_reorder
    • > Network (severe)
    var/www/wordpress/wp-content/plugins/our-services-showcase/img/spinner.gif - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 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
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (Template), #2 (Template), #3 (Template), #4 (Template)
  • Tags: There are too many tags (15 tag instead of maximum 10)
The official readme.txt might help

our-services-showcase/sc_our_services.php 85% from 13 tests

"Our Services Showcase" version 2.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("our-services-showcase.php" instead of "sc_our_services.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
No dangerous file extensions were detected4,630 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
CSS4240911,522
JavaScript4265701,241
PHP122991311,200
SVG100565
PO File14343102

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity57.00
▷ Minimum class complexity57.00
▷ Maximum class complexity57.00
Average method complexity2.47
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods38
▷ Static methods37.89%
▷ Public methods3694.74%
▷ Protected methods00.00%
▷ Private methods25.26%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants350.00%
▷ Class constants350.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
12 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/img/twitter.png4.48KB1.47KB▼ 67.18%
inc/img/google.png4.52KB1.44KB▼ 68.17%
inc/img/more.png3.45KB0.63KB▼ 81.87%
inc/script/jscolor/hv.png2.80KB7.32KB0.00%
inc/img/check.png0.35KB0.31KB▼ 9.86%