83% freelance-availability-widget

Code Review | Freelance Availability Widget

WordPress plugin Freelance Availability Widget scored83%from 54 tests.

About plugin

  • Plugin page: freelance-availab...
  • Plugin version: 2.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.4
  • WordPress version: 6.3.1
  • First release: Sep 4, 2018
  • Latest release: Oct 26, 2023
  • Number of updates: 15
  • Update frequency: every 125.5 days
  • Top authors: rhyswynne (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,087 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼5.86ms] Passed 4 tests

This is a short check of server-side resources used by Freelance Availability Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.88 ▼5.25
Dashboard /wp-admin3.34 ▲0.0442.26 ▼6.65
Posts /wp-admin/edit.php3.40 ▲0.0444.42 ▼3.66
Add New Post /wp-admin/post-new.php5.95 ▲0.0681.66 ▼7.87
Media Library /wp-admin/upload.php3.27 ▲0.0435.03 ▲1.61
Freelance Availability Widget /wp-admin/options-general.php?page=freelanceavailabilitywidget3.2633.61

Server storage [IO: ▲1.34MB] [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: 53 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_faw_freelance_availability_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Freelance Availability Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲5014.72 ▲0.371.65 ▲0.1442.87 ▲0.36
Dashboard /wp-admin2,208 ▲285.78 ▲0.1389.66 ▼1.5936.83 ▼4.49
Posts /wp-admin/edit.php2,119 ▲162.19 ▲0.2336.91 ▲0.1032.74 ▼4.72
Add New Post /wp-admin/post-new.php6,386 ▲4,85827.87 ▲4.92976.97 ▲316.6440.88 ▼11.48
Media Library /wp-admin/upload.php1,416 ▲224.34 ▲0.10104.08 ▲6.8645.90 ▲1.09
Freelance Availability Widget /wp-admin/options-general.php?page=freelanceavailabilitywidget8632.0328.3830.35

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_faw_freelance_availability_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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      require_once(FAW_PLUGIN_PATH/inc/admin-enqueue.php): failed to open stream: No such file or directory in wp-content/plugins/freelance-availability-widget/inc/core.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/freelance-availability-widget/src/render.php:3
    • > PHP Fatal error
      require_once(): Failed opening required 'FAW_PLUGIN_PATH/inc/admin-enqueue.php' (include_path='.:/usr/share/php') in wp-content/plugins/freelance-availability-widget/inc/core.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/freelance-availability-widget/inc/legacy/enqueue.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/freelance-availability-widget/inc/display.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/freelance-availability-widget/build/render.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/freelance-availability-widget/inc/enqueue.php:15
    • > PHP Warning
      Use of undefined constant FAW_PLUGIN_PATH - assumed 'FAW_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/freelance-availability-widget/inc/core.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/freelance-availability-widget/inc/options.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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Donate link: Invalid url: ""
Please take inspiration from this readme.txt

freelance-availability-widget/index.php 69% from 13 tests

Analyzing the main PHP file in "Freelance Availability Widget" version 2.2
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("freelance-availability-widget.php" instead of "index.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("Domain Path")
  • Domain Path: Prefix the domain path with a forward slash character ("/Domain Path")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin31,470 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
JSON40028,220
CSS9981252,500
PHP11128108418
JavaScript52248268
Sass27048
Markdown18016

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity35.00
▷ Minimum class complexity35.00
▷ Maximum class complexity35.00
Average method complexity9.50
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
12 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-icons_444444_256x240.png6.83KB4.17KB▼ 38.86%
inc/legacy/css/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
inc/legacy/css/images/ui-icons_555555_256x240.png6.82KB4.17KB▼ 38.82%
css/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
css/images/ui-icons_555555_256x240.png6.82KB4.17KB▼ 38.82%