62% panthermedia-stock-photo

Code Review | PantherMedia Stock Photo

WordPress plugin PantherMedia Stock Photo scored62%from 54 tests.

About plugin

  • Plugin page: panthermedia-stoc...
  • Plugin version: 1.8.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.9.7
  • WordPress version: 6.3.1
  • First release: Jun 6, 2017
  • Latest release: Jul 12, 2018
  • Number of updates: 31
  • Update frequency: every 13.1 days
  • Top authors: panthermedia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /972 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: ▲0.60MB] [CPU: ▼0.99ms] Passed 4 tests

An overview of server-side resources used by PantherMedia Stock Photo
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.08 ▲0.6250.76 ▲6.46
Dashboard /wp-admin3.94 ▲0.6357.34 ▲3.81
Posts /wp-admin/edit.php3.99 ▲0.6352.02 ▲0.70
Add New Post /wp-admin/post-new.php6.48 ▲0.5987.74 ▼14.93
Media Library /wp-admin/upload.php3.80 ▲0.5744.34 ▲7.57
Account /wp-admin/admin.php?page=panthermedia-stock-photo/classes/panthermedia-stock-photo_login3.8339.63
Search /wp-admin/admin.php?page=panthermedia-stock-photo/classes/panthermedia-stock-photo.php3.8336.17
Settings /wp-admin/admin.php?page=panthermedia-stock-photo/classes/panthermedia-stock-photo_settings3.8937.85
My Media /wp-admin/admin.php?page=panthermedia-stock-photo/classes/panthermedia-stock-photo_mymedia3.7836.29

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 50 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
plugin_panthermedia-stock-photo_settings

Browser metrics Passed 4 tests

An overview of browser requirements for PantherMedia Stock Photo
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,859 ▲7314.23 ▼0.131.90 ▼0.0343.88 ▼0.82
Dashboard /wp-admin2,228 ▲485.64 ▼0.0292.33 ▲1.4775.74 ▲31.94
Posts /wp-admin/edit.php2,142 ▲422.15 ▲0.1937.20 ▲0.6538.76 ▲3.11
Add New Post /wp-admin/post-new.php1,565 ▲3023.42 ▲5.07793.56 ▲139.6068.96 ▲9.26
Media Library /wp-admin/upload.php1,448 ▲514.22 ▼0.00101.58 ▲2.6879.85 ▲37.49
Account /wp-admin/admin.php?page=panthermedia-stock-photo/classes/panthermedia-stock-photo_login8872.0426.8328.11
Search /wp-admin/admin.php?page=panthermedia-stock-photo/classes/panthermedia-stock-photo.php1,5571.9233.1951.47
Settings /wp-admin/admin.php?page=panthermedia-stock-photo/classes/panthermedia-stock-photo_settings2,0011.7130.1126.56
My Media /wp-admin/admin.php?page=panthermedia-stock-photo/classes/panthermedia-stock-photo_mymedia9311.9031.6851.11

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
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'plugin_uninstall' not found or invalid function name
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=panthermedia-stock-photo/classes/panthermedia-stock-photo_settings
    • > Notice in wp-content/plugins/panthermedia-stock-photo/views/options.php+341
    Undefined index: value
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=panthermedia-stock-photo/classes/panthermedia-stock-photo_settings
    • > Notice in wp-content/plugins/panthermedia-stock-photo/views/options.php+341
    Trying to access array offset on value of type null

SRP 0% 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
Please take a closer look at the following
  • 6× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/panthermedia-stock-photo/files/config-default.php
    • > /wp-content/plugins/panthermedia-stock-photo/files/config-plugin.php
    • > /wp-content/plugins/panthermedia-stock-photo/panthermedia-stock-photo.php
    • > /wp-content/plugins/panthermedia-stock-photo/classes/panthermedia-stock-photo.php
    • > /wp-content/plugins/panthermedia-stock-photo/files/config-rest.php
    • > /wp-content/plugins/panthermedia-stock-photo/views/thumb.php
  • 17× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: media in wp-content/plugins/panthermedia-stock-photo/views/thumb.php on line 59
    • > PHP Notice
      Undefined variable: page in wp-content/plugins/panthermedia-stock-photo/views/paging.php on line 37
    • > PHP Notice
      Undefined variable: media in wp-content/plugins/panthermedia-stock-photo/views/thumb.php on line 31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/panthermedia-stock-photo/views/paging.php:45
    • > PHP Notice
      Undefined variable: page in wp-content/plugins/panthermedia-stock-photo/views/paging.php on line 31
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/panthermedia-stock-photo/views/account.php:32
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/panthermedia-stock-photo/views/search.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/panthermedia-stock-photo/views/media_licenses.php:35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/panthermedia-stock-photo/views/media_available.php:35
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/panthermedia-stock-photo/views/thumb.php on line 31

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

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: royalty free, stock agency, stock photo, buy photos

panthermedia-stock-photo/panthermedia-stock-photo.php 92% from 13 tests

"PantherMedia Stock Photo" version 1.8.4'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:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

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
There were no executable files found in this plugin6,585 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP156711,1803,205
PO File81,0845562,294
JavaScript3122175574
CSS210118509
JSON3003

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity112.33
▷ Minimum class complexity1.00
▷ Maximum class complexity296.00
Average method complexity4.09
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods108
▷ Static methods10.93%
▷ Public methods4440.74%
▷ Protected methods21.85%
▷ Private methods6257.41%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants116.67%
▷ Class constants583.33%
▷ Public constants5100.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
7 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
files/favicon_32x32.png0.85KB0.75KB▼ 10.74%
files/rm.png1.18KB0.94KB▼ 20.86%
files/premium.png1.51KB1.00KB▼ 33.74%
files/pager_back.png0.48KB0.41KB▼ 13.88%
files/pager_next.png0.48KB0.41KB▼ 15.52%