78% dportfolio

Code Review | DPortfolio

WordPress plugin DPortfolio scored78%from 54 tests.

About plugin

  • Plugin page: dportfolio
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.0-4.9
  • WordPress version: 6.3.1
  • First release: Jul 17, 2014
  • Latest release: May 3, 2018
  • Number of updates: 42
  • Update frequency: every 33.0 days
  • Top authors: dinamiko (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /2,068 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.24MB] [CPU: ▼0.94ms] Passed 4 tests

An overview of server-side resources used by DPortfolio
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1639.43 ▼0.52
Dashboard /wp-admin3.56 ▲0.2648.41 ▲1.72
Posts /wp-admin/edit.php3.68 ▲0.3350.20 ▲2.62
Add New Post /wp-admin/post-new.php6.15 ▲0.2685.77 ▼6.25
Media Library /wp-admin/upload.php3.49 ▲0.2636.71 ▲1.29
All Portfolios /wp-admin/edit.php?post_type=dportfolio3.5337.75
Add New /wp-admin/post-new.php?post_type=dportfolio3.6155.51
Settings /wp-admin/edit.php?post_type=dportfolio&page=dportfolio_settings3.4940.14
Support /wp-admin/edit.php?post_type=dportfolio&page=dportfolio_support3.4533.99
Categories /wp-admin/edit-tags.php?taxonomy=dportfolio_categories&post_type=dportfolio3.4841.40

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 30 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

DPortfolio: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,984 ▲22313.80 ▼0.5010.84 ▲9.1038.65 ▼5.22
Dashboard /wp-admin2,236 ▲595.58 ▼0.1083.35 ▼4.3936.74 ▼9.52
Posts /wp-admin/edit.php2,141 ▲621.99 ▼0.0234.91 ▼2.3333.47 ▲1.61
Add New Post /wp-admin/post-new.php1,560 ▲3223.21 ▲0.29609.98 ▼4.8488.78 ▲30.19
Media Library /wp-admin/upload.php1,438 ▲384.27 ▲0.04102.09 ▲1.9040.84 ▼5.69
All Portfolios /wp-admin/edit.php?post_type=dportfolio1,1131.9732.5530.14
Add New /wp-admin/post-new.php?post_type=dportfolio2,3607.57191.2976.01
Settings /wp-admin/edit.php?post_type=dportfolio&page=dportfolio_settings1,1193.2057.4328.83
Support /wp-admin/edit.php?post_type=dportfolio&page=dportfolio_support8272.0324.2229.22
Categories /wp-admin/edit-tags.php?taxonomy=dportfolio_categories&post_type=dportfolio1,3122.1233.1633.60

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=dportfolio
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/dportfolio/templates/dportfolio-after-single-content.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/dportfolio/templates/dportfolio-before-single-content.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/dportfolio/templates/dportfolio-index.php:13

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 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (DPortfolio Shortcode), #2 (DPortfolio Portfolio), #3 (DPortfolio Categories), #4 (DPortfolio Settings Thumbnails), #5 (DPortfolio Settings Portfolio page), #6 (DPortfolio Settings URL slugs)
Please take inspiration from this readme.txt

dportfolio/dportfolio.php 92% from 13 tests

The principal PHP file in "DPortfolio" v. 2.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("3.9.9" instead of "3.9.0")

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
Success! There were no dangerous files found in this plugin1,493 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP155532681,052
CSS24571190
PO File16073161
JavaScript4363390

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity18.50
▷ Minimum class complexity5.00
▷ Maximum class complexity62.00
Average method complexity3.84
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes116.67%
Methods37
▷ Static methods25.41%
▷ Public methods3183.78%
▷ Protected methods38.11%
▷ Private methods38.11%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.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
6 compressed PNG files occupy 0.16MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png31.38KB30.76KB▼ 1.99%
screenshot-4.png20.50KB19.81KB▼ 3.36%
screenshot-1.png40.83KB39.77KB▼ 2.60%
screenshot-6.png21.92KB21.28KB▼ 2.93%
screenshot-5.png14.88KB14.14KB▼ 4.92%