73% mam-image-and-video-accordion

Code Review | Image-and-Video-Accordion

WordPress plugin Image-and-Video-Accordion scored73%from 54 tests.

About plugin

  • Plugin page: mam-image-and-vid...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.5.2
  • WordPress version: 6.3.1
  • First release: Jan 20, 2015
  • Latest release: Jan 20, 2015
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: mamun_khan101010 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /837 total downloads

Benchmarks

Plugin footprint 65% 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: ▼1.96MB] [CPU: ▼53.37ms] Passed 4 tests

Analyzing server-side resources used by Image-and-Video-Accordion
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.433.76 ▼32.02
Dashboard /wp-admin2.05 ▼1.265.80 ▼44.38
Posts /wp-admin/edit.php2.05 ▼1.315.63 ▼44.25
Add New Post /wp-admin/post-new.php2.05 ▼3.845.68 ▼92.84
Media Library /wp-admin/upload.php2.05 ▼1.186.01 ▼26.66

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Image-and-Video-Accordion
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,909 ▲17413.72 ▼0.664.89 ▲3.1437.75 ▼3.90
Dashboard /wp-admin2,213 ▲255.88 ▼0.03108.92 ▼6.1341.84 ▼4.72
Posts /wp-admin/edit.php2,099 ▲102.04 ▼0.0138.77 ▼2.3734.21 ▼2.28
Add New Post /wp-admin/post-new.php1,402 ▼13117.80 ▼5.51609.30 ▼23.0055.41 ▲10.14
Media Library /wp-admin/upload.php1,398 ▲104.20 ▲0.02112.15 ▲17.0547.83 ▲6.28

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mam-all-support-accordion-plugin-main handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • 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)
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/mam-image-and-video-accordion/Image-and-Video-Accordion.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/mam-image-and-video-accordion/Image-and-Video-Accordion.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% 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:
  • Screenshots: Please add an image for screenshot #1 (Image-and-Video-Accordion in a full-width page.)
  • Contributors: Plugin contributors field is missing
Please take inspiration from this readme.txt

mam-image-and-video-accordion/Image-and-Video-Accordion.php 85% from 13 tests

"Image-and-Video-Accordion" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("mam-image-and-video-accordion.php" instead of "Image-and-Video-Accordion.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 145 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin519 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
CSS26490256
JavaScript422108216
PHP1271547

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.00
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
5 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/default/b.png1.06KB1.22KB0.00%
css/default/a.png6.09KB4.49KB▼ 26.22%
css/default/arrows.png2.32KB1.61KB▼ 30.56%
css/default/title-bar.png0.98KB0.12KB▼ 87.31%
css/default/bg.png64.30KB37.26KB▼ 42.05%