10% simple-photos-contest

Code Review | Simple Photos Contest

WordPress plugin Simple Photos Contest scored10%from 54 tests.

About plugin

  • Plugin page: simple-photos-con...
  • Plugin version: 0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-3.5.1
  • WordPress version: 6.3.1
  • First release: Mar 17, 2013
  • Latest release: Mar 26, 2013
  • Number of updates: 13
  • Update frequency: every 0.9 days
  • Top authors: Cyrille37 (76.92%)CG41 (30.77%)

Code review

54 tests

User reviews

5 reviews

Install metrics

20+ active /7,219 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/simple-photos-contest/models/SPCModelDao.php+29
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

Server metrics [RAM: ▼1.92MB] [CPU: ▼58.52ms] Passed 4 tests

Analyzing server-side resources used by Simple Photos Contest
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.12 ▼1.385.04 ▼41.57
Dashboard /wp-admin2.14 ▼1.246.55 ▼56.66
Posts /wp-admin/edit.php2.14 ▼1.265.55 ▼47.48
Add New Post /wp-admin/post-new.php2.14 ▼3.797.06 ▼88.37
Media Library /wp-admin/upload.php2.14 ▼1.136.51 ▼29.40
Votes /wp-admin/admin.php?page=spc_votes2.146.96
Add photo /wp-admin/admin.php?page=spc_photo-edit2.146.88
Configuration /wp-admin/admin.php?page=spc_configuration2.146.42
Photos /wp-admin/admin.php?page=spc_photos2.147.38
Photos order /wp-admin/admin.php?page=spc_photos-order2.147.13
Overview /wp-admin/admin.php?page=spc_overview2.146.40

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 121 new files
Database: 2 new tables, 6 new options
New tables
wp_spc_votes
wp_spc_photos
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Simple Photos Contest: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,868 ▲13314.36 ▲0.011.82 ▼0.1240.34 ▼0.21
Dashboard /wp-admin2,271 ▲945.53 ▼0.0586.17 ▲2.1240.73 ▲2.21
Posts /wp-admin/edit.php2,139 ▲391.99 ▲0.0235.31 ▼2.7639.65 ▲5.42
Add New Post /wp-admin/post-new.php1,557 ▲2923.32 ▲0.22683.46 ▲8.3657.55 ▲6.43
Media Library /wp-admin/upload.php1,442 ▲424.19 ▼0.1395.44 ▼14.5744.65 ▼1.62
Votes /wp-admin/admin.php?page=spc_votes1,0471.7726.9330.95
Add photo /wp-admin/admin.php?page=spc_photo-edit9251.8624.2628.50
Configuration /wp-admin/admin.php?page=spc_configuration1,1421.9432.0129.06
Photos /wp-admin/admin.php?page=spc_photos1,0791.8725.7630.11
Photos order /wp-admin/admin.php?page=spc_photos-order8551.8427.7929.32
Overview /wp-admin/admin.php?page=spc_overview8541.8726.8630.47

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/simple-photos-contest/models/SPCModelDao.php+29
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_spc_photos
    • wp_spc_votes
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=spc_overview
    • > Deprecated in wp-content/plugins/simple-photos-contest/models/SPCModelDao.php+29
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=spc_photos-order
    • > User deprecated in wp-includes/functions.php+5453
    Function wpdb::escape is deprecated since version 3.6.0! Use wpdb::prepare() or esc_sql() instead.

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
  • 8× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/simple-photos-contest/auth/email/connect.php
    • > /wp-content/plugins/simple-photos-contest/controlers/SimplePhotosContest.php
    • > /wp-content/plugins/simple-photos-contest/auth/google/connect.php
    • > /wp-content/plugins/simple-photos-contest/controlers/SimplePhotosContestFront.php
    • > /wp-content/plugins/simple-photos-contest/spc-wp-front-ajax.php
    • > /wp-content/plugins/simple-photos-contest/simple-photos-contest.php
    • > /wp-content/plugins/simple-photos-contest/controlers/SimplePhotosContestAdmin.php
    • > /wp-content/plugins/simple-photos-contest/auth/openid/connect.php
  • 18× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/simple-photos-contest/templates/admin-photo-edit-page.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'SimplePhotosContest' not found in wp-content/plugins/simple-photos-contest/templates/front-gallery-shortcode.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'SPCModelDao' not found in wp-content/plugins/simple-photos-contest/models/SPCPhotosDao.php:7
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/simple-photos-contest/models/SPCListTable.php on line 8
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/simple-photos-contest/models/SPCListTable.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/simple-photos-contest/templates/admin-overview-page.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'SimplePhotosContest' not found in wp-content/plugins/simple-photos-contest/templates/front-vote-popup.php:57
    • > PHP Fatal error
      Uncaught Error: Class 'SimplePhotosContestAdmin' not found in wp-content/plugins/simple-photos-contest/templates/admin-configuration-page.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'SPCQueryOptions' not found in wp-content/plugins/simple-photos-contest/templates/admin-photos-order.php:8
    • > PHP Warning
      require_once(wp-content/plugins/simple-photos-contest/models/../libs/PHPExcel_1.7.8/PHPExcel.php): failed to open stream: No such file or directory in wp-content/plugins/simple-photos-contest/models/SPCExport.php on line 6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
2 plugin tags: photos, contest

simple-photos-contest/simple-photos-contest.php Passed 13 tests

The main PHP file in "Simple Photos Contest" ver. 0.5 adds more information about the plugin and also serves as the entry point for this plugin
44 characters long description:
A simple photos contest plugin for WordPress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin8,466 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
PHP258627393,451
JavaScript113352412,983
CSS101982391,692
PO File198111213
HTML2248127

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity29.92
▷ Minimum class complexity1.00
▷ Maximum class complexity161.00
Average method complexity4.08
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes215.38%
▷ Concrete classes1184.62%
▷ Final classes00.00%
Methods123
▷ Static methods86.50%
▷ Public methods10686.18%
▷ Protected methods1713.82%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants32
▷ Global constants515.62%
▷ Class constants2784.38%
▷ Public constants27100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
58 PNG files occupy 0.29MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/fancybox-1.3.4/fancybox-x.png0.20KB0.31KB0.00%
js/fancybox-1.3.4/fancybox.png14.93KB8.47KB▼ 43.29%
css/pg-gallery/pg_next.png0.35KB0.26KB▼ 25.35%
css/pg-gallery/pg_scroll_forward.png0.23KB0.16KB▼ 28.63%
images/favoris-votez-hover.png9.83KB4.33KB▼ 55.98%