78% twitter-bootstrap-collapse-aka-accordian-shortcode

Code Review | Twitter Bootstrap Collapse aka Accordian Shortcode

WordPress plugin Twitter Bootstrap Collapse aka Accordian Shortcode scored 78% from 54 tests.

About plugin

  • Plugin page: twitter-bootstrap...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.5
  • WordPress version: 6.3.1
  • First release: Dec 17, 2012
  • Latest release: Dec 18, 2012
  • Number of updates: 7
  • Update frequency: every 0.4 days
  • Top authors: mohsinrasool (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active / 3,982 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 gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.31ms] Passed 4 tests

An overview of server-side resources used by Twitter Bootstrap Collapse aka Accordian Shortcode
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.84 ▼7.46
Dashboard /wp-admin3.32 ▲0.0148.65 ▼5.91
Posts /wp-admin/edit.php3.37 ▲0.0149.43 ▲1.42
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.63 ▼8.83
Media Library /wp-admin/upload.php3.24 ▲0.0136.37 ▲0.97

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Twitter Bootstrap Collapse aka Accordian Shortcode
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.73 ▼0.831.69 ▼0.0642.16 ▼2.65
Dashboard /wp-admin2,213 ▲214.87 ▼0.09102.55 ▼12.6538.04 ▼7.97
Posts /wp-admin/edit.php2,093 ▲42.02 ▲0.0337.20 ▼1.0830.55 ▼2.93
Add New Post /wp-admin/post-new.php1,536 ▲822.93 ▼0.20589.76 ▼59.3595.45 ▲35.48
Media Library /wp-admin/upload.php1,392 ▲74.16 ▼0.0695.89 ▼10.0241.42 ▼0.70
TBS Collapse /wp-admin/tbs_collapse.php260.440.1113.97

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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 fix the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/twitter-bootstrap-collapse-aka-accordian-shortcode/tbs_collapse.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/twitter-bootstrap-collapse-aka-accordian-shortcode/admin_view.php:9

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
    • > GET request to /wp-admin/tbs_collapse.php
    • > Network (severe)
    wp-admin/tbs_collapse.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: Add an image for screenshot #1 (screenshot-2.png)
Please take inspiration from this readme.txt

twitter-bootstrap-collapse-aka-accordian-shortcode/tbs_collapse.php 92% from 13 tests

The main PHP script in "Twitter Bootstrap Collapse aka Accordian Shortcode" version 1.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("twitter-bootstrap-collapse-aka-accordian-shortcode.php" instead of "tbs_collapse.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin104 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP22726104

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png10.10KB5.26KB▼ 47.89%
screenshot-1.png8.73KB4.74KB▼ 45.73%