84% surplus-essentials

Code Review | Surplus Essentials

WordPress plugin Surplus Essentials scored84%from 54 tests.

About plugin

  • Plugin page: surplus-essentials
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.5
  • WordPress version: 6.3.1
  • First release: May 5, 2020
  • Latest release: Aug 30, 2020
  • Number of updates: 5
  • Update frequency: every 23.4 days
  • Top authors: surplusthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,768 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲1.46MB] [CPU: ▲2.13ms] Passed 4 tests

A check of server-side resources used by Surplus Essentials
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.91 ▲1.4545.45 ▲0.23
Dashboard /wp-admin4.81 ▲1.4657.63 ▼5.18
Posts /wp-admin/edit.php4.82 ▲1.4665.92 ▲18.23
Add New Post /wp-admin/post-new.php7.34 ▲1.45102.02 ▲0.83
Media Library /wp-admin/upload.php4.70 ▲1.4645.61 ▲12.63
Instructor Categories /wp-admin/edit-tags.php?taxonomy=instructors&post_type=st_instructor4.7247.46
Surplus Essentials /wp-admin/themes.php?page=surplus_essentials_settings4.8443.17
Event Categories /wp-admin/edit-tags.php?taxonomy=events&post_type=st_event4.7246.12
All Event /wp-admin/edit.php?post_type=st_event4.7846.86
Add New /wp-admin/post-new.php?post_type=st_event4.8558.33
Course Categories /wp-admin/edit-tags.php?taxonomy=courses&post_type=st_course4.7248.40
All Instructor /wp-admin/edit.php?post_type=st_instructor4.7849.23
All Course /wp-admin/edit.php?post_type=st_course4.7850.23
Add New /wp-admin/post-new.php?post_type=st_instructor4.8558.83
Add New /wp-admin/post-new.php?post_type=st_course4.8559.30

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 67 new files
Database: no new tables, 24 new options
New WordPress options
widget_ste_icontext_widget
widget_ste_popular_post
widget_theysaidso_widget
widget_ste_cta_widget
widget_ste_event_widget
widget_ste_pro_recent_post
widget_ste_testimonial_widget
widget_ste_advertisement_widget
widget_recent-posts
widget_ste_twitter_feeds_widget
...

Browser metrics Passed 4 tests

An overview of browser requirements for Surplus Essentials
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /7,960 ▲5,18918.45 ▲4.0722.43 ▲20.5246.40 ▲3.73
Dashboard /wp-admin7,201 ▲5,01610.77 ▲4.91198.63 ▲99.2341.56 ▲6.10
Posts /wp-admin/edit.php7,111 ▲5,0256.82 ▲4.77111.39 ▲76.9135.69 ▲0.66
Add New Post /wp-admin/post-new.php6,418 ▲4,89922.65 ▼0.52677.52 ▼1.1743.31 ▼5.59
Media Library /wp-admin/upload.php6,248 ▲4,8666.22 ▲2.04128.93 ▲32.8542.61 ▼0.84
Instructor Categories /wp-admin/edit-tags.php?taxonomy=instructors&post_type=st_instructor6,3266.5799.4730.08
Surplus Essentials /wp-admin/themes.php?page=surplus_essentials_settings6,1546.4392.7555.47
Event Categories /wp-admin/edit-tags.php?taxonomy=events&post_type=st_event6,3236.7488.4327.81
All Event /wp-admin/edit.php?post_type=st_event6,2636.9596.8034.30
Add New /wp-admin/post-new.php?post_type=st_event5,4177.79256.6370.04
Course Categories /wp-admin/edit-tags.php?taxonomy=courses&post_type=st_course6,3236.7490.5128.41
All Instructor /wp-admin/edit.php?post_type=st_instructor6,1786.79103.4332.18
All Course /wp-admin/edit.php?post_type=st_course6,1766.8095.9429.51
Add New /wp-admin/post-new.php?post_type=st_instructor5,4178.00231.5859.71
Add New /wp-admin/post-new.php?post_type=st_course5,4127.68233.1558.47

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 24 options in the database
    • widget_ste_icontext_widget
    • widget_ste_custom_categories
    • widget_ste_facebook_page_widget
    • widget_ste_testimonial_widget
    • db_upgraded
    • widget_ste_cta_widget
    • widget_recent-posts
    • widget_ste_featured_page_widget
    • widget_ste_stat_counter_widget
    • widget_ste_image_text_widget
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Please fix the following items
  • 20× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/surplus-essentials/includes/widgets/widget-facebook-page.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/surplus-essentials/includes/widgets/widget-featured-page.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/surplus-essentials/includes/widgets/widget-stat-counter.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/surplus-essentials/includes/widgets/widget-recent-post.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/surplus-essentials/includes/widgets/widget-socialmedia.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/surplus-essentials/includes/widgets/widget-client-logo.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/surplus-essentials/includes/widgets/widget-contact.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/surplus-essentials/includes/widgets/widget-twitter-feeds.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/surplus-essentials/includes/widgets/widget-image-text.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/surplus-essentials/includes/widgets/widget-faqs.php:12

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 issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: widgets, surplus, essentials, custom post type

surplus-essentials/surplus-essentials.php Passed 13 tests

The main PHP file in "Surplus Essentials" ver. 1.0.3 adds more information about the plugin and also serves as the entry point for this plugin
116 characters long description:
Surplus Essentials Provides necessary features to extend WordPress functionality and for better blogging experience.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected9,177 lines of code in 51 files:
LanguageFilesBlank linesComment linesLines of code
PHP318931,4126,653
CSS9290791,885
JavaScript118965639

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity32.56
▷ Minimum class complexity1.00
▷ Maximum class complexity97.00
Average method complexity6.53
▷ Minimum method complexity1.00
▷ Maximum method complexity63.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes27
▷ Abstract classes00.00%
▷ Concrete classes27100.00%
▷ Final classes00.00%
Methods154
▷ Static methods21.30%
▷ Public methods14996.75%
▷ Protected methods00.00%
▷ Private methods53.25%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.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
6 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/css/image/no-featured-img.png4.16KB1.39KB▼ 66.51%
admin/images/ui-icons_333333_256x240.png4.27KB4.11KB▼ 3.78%
admin/images/ico-delete.png0.70KB0.72KB0.00%
admin/css/chosen-sprite.png0.51KB0.88KB0.00%
admin/images/ui-icons_999999_256x240.png6.93KB4.18KB▼ 39.62%