84% swidget-for-cmp

Code Review | SWidget for Carnegie Museums of Pittsburgh

WordPress plugin SWidget for Carnegie Museums of Pittsburgh scored 84% from 54 tests.

About plugin

  • Plugin page: swidget-for-cmp
  • Plugin version: 1.11.0
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1.0-6.0.3
  • WordPress version: 6.3.1
  • First release: Nov 20, 2020
  • Latest release: Jul 17, 2023
  • Number of updates: 26
  • Update frequency: every 37.3 days
  • Top authors: heimanj (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 930 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
Install script ran successfully

Server metrics [RAM: ▲0.20MB] [CPU: ▼2.96ms] Passed 4 tests

This is a short check of server-side resources used by SWidget for Carnegie Museums of Pittsburgh
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1939.29 ▼6.89
Dashboard /wp-admin3.51 ▲0.2147.71 ▼0.50
Posts /wp-admin/edit.php3.63 ▲0.2746.61 ▼1.16
Add New Post /wp-admin/post-new.php6.09 ▲0.2186.47 ▼3.29
Media Library /wp-admin/upload.php3.44 ▲0.2138.80 ▲3.54
SWidget for CMP /wp-admin/options-general.php?page=swidget3.4139.50

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for SWidget for Carnegie Museums of Pittsburgh
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6914.45 ▼0.131.69 ▼0.5438.35 ▼8.12
Dashboard /wp-admin2,207 ▲195.80 ▼0.01100.31 ▼2.0736.85 ▼4.18
Posts /wp-admin/edit.php2,093 ▲12.18 ▲0.1833.76 ▼9.0235.00 ▼3.55
Add New Post /wp-admin/post-new.php1,537 ▼523.24 ▲4.87673.10 ▲47.9854.03 ▼7.00
Media Library /wp-admin/upload.php1,395 ▲74.13 ▼0.07108.23 ▲4.3647.99 ▲1.98
SWidget for CMP /wp-admin/options-general.php?page=swidget1,5861.7225.1734.17

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
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function SWCMP\\add_action() in wp-content/plugins/swidget-for-cmp/settingsPage.php:75
    • > PHP Fatal error
      Uncaught Error: Call to undefined function SWCMP\\add_action() in wp-content/plugins/swidget-for-cmp/settingsPage.php:75

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Donate link: Please fix this invalid URI: ""
You can take inspiration from this readme.txt

swidget-for-cmp/swidget-cmp.php 92% from 13 tests

The principal PHP file in "SWidget for Carnegie Museums of Pittsburgh" v. 1.11.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("swidget-for-cmp.php" instead of "swidget-cmp.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected1,276 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP62505521,276

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity21.33
▷ Minimum class complexity9.00
▷ Maximum class complexity46.00
Average method complexity2.52
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes133.33%
Methods40
▷ Static methods12.50%
▷ Public methods3382.50%
▷ Protected methods717.50%
▷ Private methods00.00%
Functions47
▷ Named functions4595.74%
▷ Anonymous functions24.26%
Constants6
▷ Global constants350.00%
▷ Class constants350.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin