84% floating-action-button

Code Review | Floating Action Button

WordPress plugin Floating Action Button scored84%from 54 tests.

About plugin

  • Plugin page: floating-action-b...
  • Plugin version: 1.2.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-6.2
  • WordPress version: 6.3.1
  • First release: Jan 24, 2019
  • Latest release: Jul 29, 2023
  • Number of updates: 30
  • Update frequency: every 54.9 days
  • Top authors: farazquazi (76.67%)farazify (26.67%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active /25,790 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▼6.46ms] Passed 4 tests

A check of server-side resources used by Floating Action Button
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0637.21 ▼1.40
Dashboard /wp-admin3.48 ▲0.1848.36 ▼8.87
Posts /wp-admin/edit.php3.56 ▲0.2047.43 ▲1.72
Add New Post /wp-admin/post-new.php6.11 ▲0.2375.58 ▼13.76
Media Library /wp-admin/upload.php3.34 ▲0.1131.10 ▼1.82

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Floating Action Button
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,999 ▲25314.77 ▲0.392.11 ▲0.4243.42 ▲0.04
Dashboard /wp-admin2,383 ▲1956.68 ▲0.78123.19 ▲8.8036.79 ▼7.87
Posts /wp-admin/edit.php2,286 ▲1973.56 ▲1.5555.67 ▲20.2835.13 ▼0.93
Add New Post /wp-admin/post-new.php1,544 ▲2223.41 ▲0.44594.09 ▼38.1536.31 ▼8.99
Media Library /wp-admin/upload.php1,419 ▲314.27 ▲0.1083.43 ▼15.4341.76 ▼4.28

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • 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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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 fix the following
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/floating-action-button/views/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/floating-action-button/index.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/floating-action-button/views/fab-button.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

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
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
You can take inspiration from this readme.txt

floating-action-button/index.php 92% from 13 tests

The main PHP file in "Floating Action Button" ver. 1.2.2 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("floating-action-button.php" instead of "index.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 detected919 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP33614723
CSS220101
JavaScript311095

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
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%
Functions10
▷ Named functions330.00%
▷ Anonymous functions770.00%
Constants5
▷ Global constants5100.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
10 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/viber.png2.54KB2.62KB0.00%
assets/img/phone.png5.11KB2.39KB▼ 53.17%
assets/img/email.png4.80KB2.66KB▼ 44.62%
assets/img/intercom.png5.16KB3.12KB▼ 39.65%
assets/img/messenger.png2.92KB1.87KB▼ 35.88%