10% recent-photos-widget

Code Review | Recent photos widget

WordPress plugin Recent photos widget scored10%from 54 tests.

About plugin

  • Plugin page: recent-photos-widget
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.2.2
  • WordPress version: 6.3.1
  • First release: Jun 16, 2015
  • Latest release: Aug 17, 2015
  • Number of updates: 16
  • Update frequency: every 3.9 days
  • Top authors: stigcq (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,611 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/recent-photos-widget/recent_photos_widget.php+14
    Methods with the same name as their class will not be constructors in a future version of PHP; wp_photo_widget_plugin has a deprecated constructor

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

Analyzing server-side resources used by Recent photos widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.384.90 ▼32.86
Dashboard /wp-admin2.11 ▼1.206.32 ▼43.75
Posts /wp-admin/edit.php2.11 ▼1.256.59 ▼40.10
Add New Post /wp-admin/post-new.php2.11 ▼3.785.67 ▼96.04
Media Library /wp-admin/upload.php2.11 ▼1.126.01 ▼28.29

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_posts_photos_widget
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Recent photos widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.47 ▲0.091.59 ▲0.0740.25 ▲1.19
Dashboard /wp-admin2,206 ▲175.79 ▲0.90101.04 ▼3.4939.01 ▼9.08
Posts /wp-admin/edit.php2,086 ▼32.02 ▼0.1236.13 ▲1.0431.38 ▼5.44
Add New Post /wp-admin/post-new.php1,534 ▼723.32 ▲0.04679.24 ▲38.7048.19 ▼9.00
Media Library /wp-admin/upload.php1,388 ▼04.18 ▼0.0795.49 ▼0.4444.78 ▲3.59

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/recent-photos-widget/recent_photos_widget.php+14
    Methods with the same name as their class will not be constructors in a future version of PHP; wp_photo_widget_plugin has a deprecated constructor
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_posts_photos_widget
    • widget_recent-posts

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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/recent-photos-widget/recent_photos_widget.php:14

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)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
2 plugin tags: photos, widget

recent-photos-widget/recent_photos_widget.php 92% from 13 tests

The principal PHP file in "Recent photos widget" v. 1.3 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("recent-photos-widget.php" instead of "recent_photos_widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin205 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP14314102
JavaScript115463
CSS15740

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected