84% astra-widgets

Code Review | Astra Widgets

WordPress plugin Astra Widgets scored84%from 54 tests.

About plugin

  • Plugin page: astra-widgets
  • Plugin version: 1.2.12
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3
  • WordPress version: 6.3.1
  • First release: Dec 24, 2018
  • Latest release: Aug 21, 2023
  • Number of updates: 34
  • Update frequency: every 50.0 days
  • Top authors: brainstormworg (58.82%)patilvikasj (29.41%)Nikschavan (17.65%)

Code review

54 tests

User reviews

17 reviews

Install metrics

300,000+ active /3,323,814 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.47MB] [CPU: ▲0.30ms] Passed 4 tests

Analyzing server-side resources used by Astra Widgets
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.90 ▲0.4440.43 ▼3.93
Dashboard /wp-admin3.82 ▲0.5251.01 ▲0.60
Posts /wp-admin/edit.php3.88 ▲0.5251.60 ▲3.86
Add New Post /wp-admin/post-new.php6.36 ▲0.4796.99 ▲9.81
Media Library /wp-admin/upload.php3.69 ▲0.4538.65 ▲0.66

Server storage [IO: ▲3.61MB] [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, 9 new options
New WordPress options
widget_astra-widget-list-icons
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_astra-widget-address
theysaidso_admin_options
db_upgraded
widget_astra-widget-social-profiles
widget_recent-posts

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 /2,793 ▲714.35 ▲0.001.67 ▼0.2939.60 ▼6.03
Dashboard /wp-admin2,202 ▲255.66 ▲0.0090.88 ▼15.8441.46 ▼1.46
Posts /wp-admin/edit.php2,104 ▲72.03 ▲0.0241.19 ▲6.2535.47 ▲0.51
Add New Post /wp-admin/post-new.php1,541 ▲1318.36 ▼4.74610.60 ▼59.6368.50 ▲7.07
Media Library /wp-admin/upload.php1,398 ▼24.24 ▲0.0997.32 ▼16.5441.31 ▼9.27

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 9 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_astra-widget-address
    • widget_astra-widget-list-icons
    • widget_astra-widget-social-profiles

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 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
    • > 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-loader.php' (include_path='.:/usr/share/php') in wp-content/plugins/astra-widgets/classes/class-astra-widgets.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-list-icons.php:16
    • > 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 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.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: Call to undefined function add_action() in wp-content/plugins/astra-widgets/classes/class-astra-widgets-helper.php:57

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.12
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,423 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code
JSON21057,765
PHP124641,0482,403
CSS237882778
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.60
Average class complexity38.70
▷ Minimum class complexity2.00
▷ Maximum class complexity79.00
Average method complexity4.93
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods96
▷ Static methods1717.71%
▷ Public methods7881.25%
▷ Protected methods00.00%
▷ Private methods1818.75%
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