78% flexible-slide-to-top-accordion

Code Review | Flexible Slide To Top Accordion

WordPress plugin Flexible Slide To Top Accordion scored78%from 54 tests.

About plugin

  • Plugin page: flexible-slide-to...
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.2.4
  • WordPress version: 6.3.1
  • First release: Dec 10, 2014
  • Latest release: Aug 17, 2015
  • Number of updates: 13
  • Update frequency: every 19.2 days
  • Top authors: ravisakya (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /2,201 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.06MB] [CPU: ▼1.94ms] Passed 4 tests

This is a short check of server-side resources used by Flexible Slide To Top Accordion
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0641.96 ▲5.15
Dashboard /wp-admin3.37 ▲0.0748.75 ▼1.82
Posts /wp-admin/edit.php3.49 ▲0.1456.08 ▲5.58
Add New Post /wp-admin/post-new.php5.96 ▲0.0786.82 ▼14.39
Media Library /wp-admin/upload.php3.28 ▲0.0537.37 ▲3.30
Accordion Options /wp-admin/options-general.php?page=accordion-slide-up3.2433.21

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Flexible Slide To Top Accordion
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,954 ▲21915.20 ▲0.623.62 ▲1.9042.81 ▼0.37
Dashboard /wp-admin2,352 ▲1646.49 ▲0.65134.49 ▲31.3741.70 ▼7.03
Posts /wp-admin/edit.php2,260 ▲1683.38 ▲1.3255.41 ▲14.6034.56 ▼0.80
Add New Post /wp-admin/post-new.php1,533 ▼918.35 ▲0.14572.11 ▼66.8133.52 ▼24.55
Media Library /wp-admin/upload.php1,393 ▲84.18 ▼0.0384.13 ▼17.1744.61 ▲1.44
Accordion Options /wp-admin/options-general.php?page=accordion-slide-up1,0893.0437.5923.79

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=accordion-slide-up
    • > Notice in wp-content/plugins/flexible-slide-to-top-accordion/functions.php+158
    Undefined variable: checked

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/flexible-slide-to-top-accordion/functions.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/flexible-slide-to-top-accordion/functions.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (Backend Page) image missing
The official readme.txt is a good inspiration

flexible-slide-to-top-accordion/index.php 92% from 13 tests

This is the main PHP file of "Flexible Slide To Top Accordion" version 0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("flexible-slide-to-top-accordion.php" instead of "index.php")

Code Analysis Passed 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 plugin1,077 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript4137176424
CSS3375358
PHP25446295

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.20
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%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
8 PNG files occupy 0.10MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/add-button.png5.47KB2.12KB▼ 61.24%
images/down.png2.97KB0.13KB▼ 95.76%
img/prev.png1.33KB1.59KB0.00%
screenshot-1.png91.35KB30.30KB▼ 66.83%
images/button-remove.png1.18KB1.03KB▼ 12.85%