83% wp-news-photo-gallery

Code Review | WP News Photo Gallery

WordPress plugin WP News Photo Gallery scored83%from 54 tests.

About plugin

  • Plugin page: wp-news-photo-gal...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.1
  • WordPress version: 6.3.1
  • First release: Feb 25, 2019
  • Latest release: Feb 27, 2019
  • Number of updates: 6
  • Update frequency: every 0.5 days
  • Top authors: dhasib (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /548 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▼0.08ms] Passed 4 tests

An overview of server-side resources used by WP News Photo Gallery
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1438.23 ▲1.47
Dashboard /wp-admin3.43 ▲0.1344.45 ▼2.83
Posts /wp-admin/edit.php3.55 ▲0.1946.83 ▼0.68
Add New Post /wp-admin/post-new.php6.04 ▲0.1591.06 ▲2.14
Media Library /wp-admin/upload.php3.36 ▲0.1333.23 ▲1.73
Gallery Settings /wp-admin/edit.php?post_type=wpnpg&page=wpnpg-slider-page3.3333.18
Add New /wp-admin/post-new.php?post_type=wpnpg3.4745.99
All Items /wp-admin/edit.php?post_type=wpnpg3.4030.38

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 19 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_wpnpg-recent-posts
widget_recent-comments
widget_recent-posts
wpnpg
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

WP News Photo Gallery: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,948 ▲18713.86 ▼0.678.02 ▲6.3231.56 ▼15.20
Dashboard /wp-admin2,256 ▲795.82 ▲0.2987.20 ▼14.8239.88 ▼4.22
Posts /wp-admin/edit.php2,160 ▲602.27 ▲0.2540.82 ▲5.3138.05 ▲3.55
Add New Post /wp-admin/post-new.php1,583 ▲5718.45 ▼5.12616.64 ▼72.5845.65 ▼18.10
Media Library /wp-admin/upload.php1,461 ▲614.41 ▲0.2198.26 ▼6.1943.08 ▼2.24
Gallery Settings /wp-admin/edit.php?post_type=wpnpg&page=wpnpg-slider-page1,1471.8529.2230.91
Add New /wp-admin/post-new.php?post_type=wpnpg2,3407.77171.8663.60
All Items /wp-admin/edit.php?post_type=wpnpg1,1302.2135.8831.05

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 8 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_wpnpg-recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • wpnpg

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > 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/wp-news-photo-gallery/wp-news-photo-gallery.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wp-news-photo-gallery/archive-wpnpg.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-news-photo-gallery/lib/functions.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wp-news-photo-gallery/single-wpnpg.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/wp-news-photo-gallery/wp-news-photo-gallery.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-news-photo-gallery/lib/widget.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Gallery View), #2 (Gallery Archive), #3 (Gallery Settings)
Please take inspiration from this readme.txt

wp-news-photo-gallery/wp-news-photo-gallery.php 85% from 13 tests

This is the main PHP file of "WP News Photo Gallery" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 146 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin3,576 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
CSS43301,735
JavaScript32151541,260
PHP57481581

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity19.00
▷ Minimum class complexity19.00
▷ Maximum class complexity19.00
Average method complexity4.60
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 1.78MB with 0.91MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png1,317.90KB261.05KB▼ 80.19%
img/review.png0.64KB0.64KB0.00%
screenshot-3.png18.39KB9.91KB▼ 46.10%
screenshot-2.png482.94KB102.55KB▼ 78.76%