83% quran-shortcode

Code Review | Quran Shortcode

WordPress plugin Quran Shortcode scored83%from 54 tests.

About plugin

  • Plugin page: quran-shortcode
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.0.2
  • WordPress version: 6.3.1
  • First release: Jul 10, 2016
  • Latest release: Oct 2, 2022
  • Number of updates: 12
  • Update frequency: every 190.0 days
  • Top authors: edckwt (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /2,399 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.09MB] [CPU: ▼2.99ms] Passed 4 tests

Server-side resources used by Quran Shortcode
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0938.66 ▲1.12
Dashboard /wp-admin3.39 ▲0.0943.40 ▼4.59
Posts /wp-admin/edit.php3.51 ▲0.1551.10 ▲3.19
Add New Post /wp-admin/post-new.php5.98 ▲0.0981.42 ▼9.97
Media Library /wp-admin/upload.php3.32 ▲0.0935.15 ▲1.47

Server storage [IO: ▲4.67MB] [DB: ▲3.11MB] Passed 3 tests

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 69 new files
Database: 3 new tables, 9 new options
New tables
wp_edc_en_quran
wp_edc_suraames
wp_edc_quran
New WordPress options
edc_quran_shortcode_template
theysaidso_admin_options
edc_quran_shortcode_template_custom
db_upgraded
widget_recent-comments
widget_theysaidso_widget
edc_quran_shortcode_version
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Quran Shortcode: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲4714.76 ▲0.362.04 ▲0.4655.18 ▲17.47
Dashboard /wp-admin2,212 ▲355.58 ▼0.0982.02 ▼5.3883.42 ▲38.84
Posts /wp-admin/edit.php2,120 ▲201.97 ▼0.0235.83 ▼2.6833.65 ▲1.15
Add New Post /wp-admin/post-new.php1,541 ▲1523.57 ▲0.68718.46 ▲60.0650.98 ▼3.31
Media Library /wp-admin/upload.php1,417 ▲174.23 ▼0.0697.30 ▼18.0579.24 ▲31.19

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

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)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/quran-shortcode/assets.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/quran-shortcode/index.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/quran-shortcode/option_page.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/quran-shortcode/button.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/quran-shortcode/template.php:77

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 90% 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
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (Button), #2 (Searching), #3 (View in post), #4 (Setting)
You can take inspiration from this readme.txt

quran-shortcode/index.php 85% from 13 tests

The main PHP file in "Quran Shortcode" ver. 1.4 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 167 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("quran-shortcode.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
Everything looks great! No dangerous files found in this plugin1,174 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP106217511
CSS1576378
JavaScript34553285

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
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%
Functions29
▷ Named functions29100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
49 PNG files occupy 1.39MB with 0.74MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/quranboder_07.png4.07KB1.96KB▼ 51.89%
css/images/temp4_08.png9.55KB5.71KB▼ 40.19%
css/images/temp1_.png100.68KB34.16KB▼ 66.07%
css/images/temp4_07.png3.87KB2.10KB▼ 45.86%
css/images/temp3_05.png14.01KB5.36KB▼ 61.73%