84% astra-widgets

Code Review | Astra Widgets

WordPress plugin Astra Widgets scored 84% from 54 tests.

About plugin

  • Plugin page: astra-widgets
  • Plugin version: 1.2.9
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.8
  • WordPress version: 5.8.1
  • First release: Dec 24, 2018
  • Latest release: Jul 14, 2021
  • Number of updates: 26
  • Update frequency: every 35.9 days
  • Top authors: brainstormworg (46.15%)patilvikasj (38.46%)Nikschavan (23.08%)

Code review

54 tests

User reviews

13 reviews

Install metrics

300,000+ active / 2,237,427 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.46MB] [CPU: ▼171.89ms] Passed 4 tests

Analyzing server-side resources used by Astra Widgets
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.23 ▲0.5138.70 ▲14.91
Dashboard /wp-admin3.56 ▲0.5045.61 ▼2.13
Posts /wp-admin/edit.php3.61 ▲0.5045.17 ▼4.28
Add New Post /wp-admin/post-new.php5.85 ▲0.4290.55 ▼690.41
Media Library /wp-admin/upload.php3.44 ▲0.4437.05 ▲9.26

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 51 new files
Database: no new tables, 3 new options
New WordPress options
widget_astra-widget-address
widget_astra-widget-list-icons
widget_astra-widget-social-profiles

Browser metrics Passed 4 tests

An overview of browser requirements for Astra Widgets
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,695 ▲9916.00 ▲0.438.92 ▼2.7648.68 ▲0.32
Dashboard /wp-admin2,975 ▲416.21 ▲0.17184.83 ▲37.99109.06 ▼3.66
Posts /wp-admin/edit.php2,745 ▲62.75 ▲0.0564.58 ▼0.8993.18 ▼2.72
Add New Post /wp-admin/post-new.php1,502 ▼18118.82 ▲0.10396.45 ▼19.63108.40 ▲2.28
Media Library /wp-admin/upload.php1,813 ▲65.09 ▲0.06162.25 ▲3.59118.82 ▲5.82

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 3 options in the database
    • widget_astra-widget-social-profiles
    • widget_astra-widget-list-icons
    • widget_astra-widget-address

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

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 take a closer look at the following
  • 10× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      require_once(): Failed opening required 'ASTRA_WIDGETS_DIRclasses/class-astra-widgets-loader.php' (include_path='.:/usr/share/php') in wp-content/plugins/astra-widgets/classes/class-astra-widgets.php on line 41
    • > PHP Warning
      Use of undefined constant ASTRA_WIDGETS_DIR - assumed 'ASTRA_WIDGETS_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/astra-widgets/classes/class-astra-widgets.php on line 41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/astra-widgets/classes/class-astra-widgets-helper.php:57
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/astra-widgets/classes/widgets/class-astra-widget-list-icons.php:16
    • > PHP Warning
      require_once(ASTRA_WIDGETS_DIRclasses/class-astra-widgets-loader.php): failed to open stream: No such file or directory in wp-content/plugins/astra-widgets/classes/class-astra-widgets.php on line 41
    • > PHP Fatal error
      require_once(): Failed opening required 'ASTRA_WIDGETS_DIRclasses/class-astra-widgets-helper.php' (include_path='.:/usr/share/php') in wp-content/plugins/astra-widgets/classes/class-astra-widgets-loader.php on line 41
    • > PHP Warning
      require_once(ASTRA_WIDGETS_DIRclasses/class-astra-widgets-helper.php): failed to open stream: No such file or directory in wp-content/plugins/astra-widgets/classes/class-astra-widgets-loader.php on line 41
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/astra-widgets/classes/widgets/class-astra-widget-social-profiles.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/astra-widgets/classes/widgets/class-astra-widget-address.php:16
    • > PHP Warning
      Use of undefined constant ASTRA_WIDGETS_DIR - assumed 'ASTRA_WIDGETS_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/astra-widgets/classes/class-astra-widgets-loader.php on line 41

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 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3 in astra-widgets/assets to your readme.txt
Please take inspiration from this readme.txt

astra-widgets/astra-widgets.php Passed 13 tests

Analyzing the main PHP file in "Astra Widgets" version 1.2.9
64 characters long description:
The Fastest Way to Add More Widgets into Your WordPress Website.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin61,320 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code
JSON21057,765
PHP124511,0072,312
CSS237676766
JavaScript8118130477

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity35.80
▷ Minimum class complexity2.00
▷ Maximum class complexity72.00
Average method complexity4.74
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods93
▷ Static methods1718.28%
▷ Public methods7580.65%
▷ Protected methods00.00%
▷ Private methods1819.35%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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
There were not PNG files found in your plugin