68% daneshjooyar-post-gallery

Code Review | Daneshjooyar Post Gallery

WordPress plugin Daneshjooyar Post Gallery scored68%from 54 tests.

About plugin

  • Plugin page: daneshjooyar-post...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-4.8.0
  • WordPress version: 6.3.1
  • First release: Jul 25, 2017
  • Latest release: Jul 27, 2017
  • Number of updates: 14
  • Update frequency: every 0.2 days
  • Top authors: hamedmoodi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /803 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▼1.90MB] [CPU: ▼57.21ms] Passed 4 tests

Analyzing server-side resources used by Daneshjooyar Post Gallery
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.374.71 ▼39.29
Dashboard /wp-admin2.12 ▼1.236.67 ▼55.62
Posts /wp-admin/edit.php2.12 ▼1.247.02 ▼39.54
Add New Post /wp-admin/post-new.php2.12 ▼3.776.13 ▼94.37
Media Library /wp-admin/upload.php2.12 ▼1.115.51 ▼25.22

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 64 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Daneshjooyar Post Gallery
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲4314.37 ▲0.031.46 ▼0.1635.39 ▼8.47
Dashboard /wp-admin2,192 ▲175.60 ▼0.1194.42 ▼18.8544.31 ▼2.50
Posts /wp-admin/edit.php2,103 ▲31.95 ▼0.0639.54 ▼4.5636.73 ▼0.63
Add New Post /wp-admin/post-new.php6,226 ▲4,70026.23 ▲2.64795.31 ▲140.9754.03 ▲9.16
Media Library /wp-admin/upload.php1,403 ▲34.22 ▲0.0296.82 ▼1.0743.70 ▼0.23

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/daneshjooyar-post-gallery/Core/DYPG_Core.php+99
    Use of undefined constant DYPG_DIR - assumed 'DYPG_DIR' (this will throw an Error in a future version of PHP)
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/daneshjooyar-post-gallery/Core/View/shortcode_gallery_view.php
    • > /wp-content/plugins/daneshjooyar-post-gallery/daneshjooyar-post-gallery.php
    • > /wp-content/plugins/daneshjooyar-post-gallery/core/view/gallery-shortcode.php
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined variable: dy_post_gallery_images in wp-content/plugins/daneshjooyar-post-gallery/Core/View/shortcode_gallery_view.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/daneshjooyar-post-gallery/core/view/metabox-view.php:8
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/daneshjooyar-post-gallery/core/view/gallery-shortcode.php on line 8
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/daneshjooyar-post-gallery/Core/View/shortcode_gallery_view.php on line 2
    • > PHP Notice
      Undefined variable: dy_post_gallery_images in wp-content/plugins/daneshjooyar-post-gallery/core/view/gallery-shortcode.php on line 8

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 Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: slick, swipebox, slider, gallery

daneshjooyar-post-gallery/daneshjooyar-post-gallery.php Passed 13 tests

"Daneshjooyar Post Gallery" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
46 characters long description:
This is simple Gallery for post with shortcode

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
No dangerous file extensions were detected713 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
CSS55515372
PHP868193227
JavaScript4151960
PO File1162440
SVG21014

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity19.00
▷ Minimum class complexity19.00
▷ Maximum class complexity19.00
Average method complexity2.17
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods1680.00%
▷ Protected methods00.00%
▷ Private methods420.00%
Functions10
▷ Named functions00.00%
▷ Anonymous functions10100.00%
Constants12
▷ Global constants12100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
Assets/img/play.png7.97KB7.88KB▼ 1.14%
assets/img/icons.png0.71KB0.43KB▼ 39.64%
Assets/img/icons.png0.71KB0.43KB▼ 39.64%
assets/img/play_icon.png7.97KB7.88KB▼ 1.14%