78% spec-theme-options

Code Review | SPEC Theme Options

WordPress plugin SPEC Theme Options scored78%from 54 tests.

About plugin

  • Plugin page: spec-theme-options
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.3.2
  • WordPress version: 6.3.1
  • First release: Mar 30, 2020
  • Latest release: Jun 11, 2020
  • Number of updates: 9
  • Update frequency: every 8.7 days
  • Top authors: 1specindia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /451 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.97MB] [CPU: ▼5.79ms] Passed 4 tests

Server-side resources used by SPEC Theme Options
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /5.15 ▲1.6843.23 ▲6.39
Dashboard /wp-admin4.98 ▲1.6753.24 ▲4.92
Posts /wp-admin/edit.php5.03 ▲1.6756.07 ▲10.64
Add New Post /wp-admin/post-new.php4.80 ▼1.0941.67 ▼44.30
Media Library /wp-admin/upload.php4.84 ▲1.6144.95 ▲9.84
Redux Framework /wp-admin/tools.php?page=redux-framework5.3540.73
All Items /wp-admin/edit.php?post_type=portfolio4.9445.08
Add New /wp-admin/post-new.php?post_type=portfolio5.0556.36
Add New /wp-admin/post-new.php?post_type=testimonial5.0458.09
All Items /wp-admin/edit.php?post_type=testimonial4.9447.14
Import Demo Data /wp-admin/themes.php?page=pt-one-click-demo-import5.0138.14
Portfolio Category /wp-admin/edit-tags.php?taxonomy=portfolio-category&post_type=portfolio4.8342.13

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 1,003 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for SPEC Theme Options
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,965 ▲17913.78 ▼0.668.28 ▲6.5237.14 ▼3.71
Dashboard /wp-admin2,279 ▲1025.52 ▼0.1489.77 ▼0.5240.51 ▲0.14
Posts /wp-admin/edit.php2,187 ▲872.02 ▼0.0138.42 ▲3.3936.89 ▼1.11
Add New Post /wp-admin/post-new.php1,597 ▲6023.41 ▲5.34672.84 ▲58.4159.93 ▼4.33
Media Library /wp-admin/upload.php1,484 ▲874.19 ▼0.0293.76 ▼14.0441.11 ▼3.24
Redux Framework /wp-admin/tools.php?page=redux-framework1,1163.6574.5766.13
All Items /wp-admin/edit.php?post_type=portfolio1,1651.9830.0330.26
Add New /wp-admin/post-new.php?post_type=portfolio2,4267.78170.6363.64
Add New /wp-admin/post-new.php?post_type=testimonial2,3367.74155.1153.74
All Items /wp-admin/edit.php?post_type=testimonial1,1481.9530.3831.65
Import Demo Data /wp-admin/themes.php?page=pt-one-click-demo-import1,0052.0338.3744.04
Portfolio Category /wp-admin/edit-tags.php?taxonomy=portfolio-category&post_type=portfolio1,3552.1227.3528.84

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/spec-theme-options/public/partials/spec-theme-options-public-display.php
    • > /wp-content/plugins/spec-theme-options/extensions/one-click-demo-import/one-click-demo-import.php
    • > /wp-content/plugins/spec-theme-options/admin/partials/spec-theme-options-admin-display.php
  • 54× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/spec-theme-options/extensions/cmb2/includes/types/CMB2_Type_File_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/spec-theme-options/extensions/custom-post/custom-post.php:63
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/spec-theme-options/extensions/cmb2/includes/types/CMB2_Type_Oembed.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Setting' not found in wp-content/plugins/spec-theme-options/extensions/one-click-demo-import/inc/CustomizerOption.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Radio' not found in wp-content/plugins/spec-theme-options/extensions/cmb2/includes/types/CMB2_Type_Multicheck.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/spec-theme-options/extensions/cmb2/includes/types/CMB2_Type_Taxonomy_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Select' not found in wp-content/plugins/spec-theme-options/extensions/cmb2/includes/types/CMB2_Type_Taxonomy_Select_Hierarchical.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text_Date' not found in wp-content/plugins/spec-theme-options/extensions/cmb2/includes/types/CMB2_Type_Text_Time.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/spec-theme-options/extensions/redux/ReduxCore/templates/panel/header-stickybar.tpl.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/spec-theme-options/extensions/cmb2/includes/types/CMB2_Type_Colorpicker.php:13

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

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Contributors: The plugin contributors field is not present
You can take inspiration from this readme.txt

spec-theme-options/spec-theme-options.php Passed 13 tests

The main file in "SPEC Theme Options" v. 1.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
63 characters long description:
A simple plugin to extend functionalities of SPEC INDIA Themes.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin124,270 lines of code in 655 files:
LanguageFilesBlank linesComment linesLines of code
PHP2289,44320,42235,756
PO File12014,31518,50232,323
JavaScript1125,2033,02620,129
CSS1067,1331,53216,034
SVG40129,995
Sass801,569829,279
Markdown32300690
JSON20064

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please tend to the following items
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 117)
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity29.65
▷ Minimum class complexity1.00
▷ Maximum class complexity334.00
Average method complexity4.86
▷ Minimum method complexity1.00
▷ Maximum method complexity117.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes234
▷ Abstract classes135.56%
▷ Concrete classes22194.44%
▷ Final classes10.45%
Methods1,744
▷ Static methods44425.46%
▷ Public methods1,34577.12%
▷ Protected methods28316.23%
▷ Private methods1166.65%
Functions64
▷ Named functions5687.50%
▷ Anonymous functions812.50%
Constants116
▷ Global constants76.03%
▷ Class constants10993.97%
▷ Public constants109100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
70 compressed PNG files occupy 0.11MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
extensions/redux/ReduxCore/assets/img/raw/toggle_tabs.png0.35KB0.35KB0.00%
extensions/redux/ReduxCore/assets/img/raw/jquery-ui-bootstrap/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
extensions/redux/ReduxCore/assets/img/3cl.png0.34KB0.33KB0.29%
extensions/redux/ReduxCore/assets/img/4-col-portfolio.png0.16KB0.17KB0.00%
extensions/redux/ReduxCore/assets/img/jquery-ui-bootstrap/ui-bg_glass_75_ffffff_1x400.png0.10KB0.10KB0.00%