10% prospect

Code Review | Prospect

WordPress plugin Prospect scored10%from 54 tests.

About plugin

  • Plugin page: prospect
  • Plugin version: 1.8.9.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.0-4.7.2
  • WordPress version: 6.3.1
  • First release: Mar 9, 2016
  • Latest release: Nov 30, 2018
  • Number of updates: 33
  • Update frequency: every 30.2 days
  • Top authors: msnewton (87.88%)uncdigitalinnovationlab (15.15%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,682 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/prospect/php/class-attribute.php+78
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▼0.61MB] [CPU: ▼47.88ms] Passed 4 tests

Server-side resources used by Prospect
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.37 ▼0.098.65 ▼28.40
Dashboard /wp-admin3.39 ▲0.0911.78 ▼37.41
Posts /wp-admin/edit.php3.39 ▲0.0412.04 ▼37.49
Add New Post /wp-admin/post-new.php3.39 ▼2.4910.73 ▼88.23
Media Library /wp-admin/upload.php3.39 ▲0.1713.62 ▼18.19
Volumes /wp-admin/edit.php?post_type=prsp-volume3.4011.73
Perspectives /wp-admin/edit.php?post_type=prsp-prspctv3.4010.81
Settings /wp-admin/admin.php?page=prsp-settings-page3.3911.08
Exhibits /wp-admin/edit.php?post_type=prsp-exhibit3.409.75
Records /wp-admin/edit.php?post_type=prsp-record3.4013.51
Templates /wp-admin/edit.php?post_type=prsp-template3.4011.03
Readings /wp-admin/edit.php?post_type=prsp-reading3.4010.32
CSV Importer Improved /wp-admin/tools.php?page=prospect/lib/csv-importer/csv_importer.php3.3910.04
Map Library /wp-admin/edit.php?post_type=prsp-map3.4012.05
Attributes /wp-admin/edit.php?post_type=prsp-attribute3.4010.15

Server storage [IO: ▲5.13MB] [DB: ▲0.02MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 138 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
widget_recent-posts
csv_importer_cat
csv_importer_import_as_draft
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Prospect
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,908 ▲16214.48 ▼0.111.57 ▼0.2439.62 ▼0.24
Dashboard /wp-admin2,290 ▲1025.84 ▲0.98108.57 ▲5.9138.93 ▼4.69
Posts /wp-admin/edit.php2,173 ▲842.01 ▲0.0041.19 ▲1.3634.49 ▼0.88
Add New Post /wp-admin/post-new.php1,606 ▲7623.33 ▲0.16612.92 ▼91.3051.40 ▼4.85
Media Library /wp-admin/upload.php1,475 ▲844.21 ▼0.0893.61 ▼8.9041.49 ▼3.29
Volumes /wp-admin/edit.php?post_type=prsp-volume1,1341.9832.9927.51
Perspectives /wp-admin/edit.php?post_type=prsp-prspctv1,1371.9634.4130.22
Settings /wp-admin/admin.php?page=prsp-settings-page9062.0623.5628.79
Exhibits /wp-admin/edit.php?post_type=prsp-exhibit1,1342.0129.5525.73
Records /wp-admin/edit.php?post_type=prsp-record1,2191.9331.1630.57
Templates /wp-admin/edit.php?post_type=prsp-template1,1341.9830.4229.60
Readings /wp-admin/edit.php?post_type=prsp-reading1,1341.9530.5028.28
CSV Importer Improved /wp-admin/tools.php?page=prospect/lib/csv-importer/csv_importer.php9042.0325.2334.37
Map Library /wp-admin/edit.php?post_type=prsp-map1,1771.9431.0630.54
Attributes /wp-admin/edit.php?post_type=prsp-attribute1,1531.9531.0726.46

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/prospect/php/class-attribute.php+78
    Array and string offset access syntax with curly braces is deprecated
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • db_upgraded
    • can_compress_scripts
    • csv_importer_import_as_draft
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • csv_importer_cat
    • widget_recent-comments

Smoke tests 50% 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)
Almost there, just fix the following server-side errors
  • 18 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=prsp-attribute
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/prospect/php/class-attribute.php+78
    Array and string offset access syntax with curly braces is deprecated
    • > GET request to /wp-admin/admin.php?page=prsp-settings-page
    • > Notice in wp-content/plugins/prospect/php/class-prospect-admin.php+2525
    Trying to access array offset on value of type bool

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
Please take a closer look at the following
  • 16× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_title() in wp-content/plugins/prospect/php/view-exhibit.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/prospect/php/scripts/english-us/edit-attribute.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/prospect/php/view-template.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/prospect/php/scripts/english-us/view-volume.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/prospect/php/scripts/english-us/edit-exhibit.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/prospect/lib/csv-importer/csv_importer.php:628
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/prospect/lib/csv-importer/examples/functions.inc.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/prospect/php/scripts/english-us/view-record.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/prospect/php/scripts/english-us/edit-record.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_title() in wp-content/plugins/prospect/php/view-volume.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
2 plugin tags: digital humanities, data visualization

prospect/prospect.php Passed 13 tests

The principal PHP file in "Prospect" v. 1.8.9.1 is loaded by WordPress automatically on each request
63 characters long description:
Digital Humanities platform for visualizing curated collections

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
No dangerous file extensions were detected92,736 lines of code in 85 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript3811,65214,15576,988
PHP281,4122,87411,018
CSS159906464,539
Markdown2520118
JSON20073

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity62.40
▷ Minimum class complexity1.00
▷ Maximum class complexity349.00
Average method complexity4.36
▷ Minimum method complexity1.00
▷ Maximum method complexity68.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods275
▷ Static methods3412.36%
▷ Public methods26395.64%
▷ Protected methods82.91%
▷ Private methods41.45%
Functions17
▷ Named functions1694.12%
▷ Anonymous functions15.88%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
21 PNG files occupy 0.77MB with 0.23MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/leaflet/images/marker-icon.png1.71KB1.56KB▼ 8.59%
css/images/ui-icons_454545_256x240.png242.99KB7.40KB▼ 96.96%
lib/hopscotch/img/sprite-orange.png5.25KB4.02KB▼ 23.48%
lib/hopscotch/img/sprite-green.png5.28KB4.01KB▼ 23.96%
lib/leaflet/images/marker-shadow.png0.78KB1.16KB0.00%