58% personal-newsletter

Code Review | Personal Newsletter

WordPress plugin Personal Newsletter scored58%from 54 tests.

About plugin

  • Plugin page: personal-newsletter
  • Plugin version: 0.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Jan 21, 2013
  • Latest release: Jan 21, 2013
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: jperelli (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /988 total downloads

Benchmarks

Plugin footprint 48% 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 gracefully, with no errors

Server metrics [RAM: ▼1.75MB] [CPU: ▼56.11ms] Passed 4 tests

This is a short check of server-side resources used by Personal Newsletter
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.10 ▼1.375.43 ▼40.98
Dashboard /wp-admin2.31 ▼1.006.88 ▼45.77
Posts /wp-admin/edit.php2.31 ▼1.057.00 ▼40.11
Add New Post /wp-admin/post-new.php2.31 ▼3.588.18 ▼97.57
Media Library /wp-admin/upload.php2.31 ▼0.926.36 ▼29.57
Añadir nueva /wp-admin/admin.php?page=personal-add-new2.317.54
Campañas /wp-admin/admin.php?page=personal-campaigns2.319.06

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 14 new files
Database: 1 new table, 7 new options
New tables
wp_personal_newsletter
New WordPress options
widget_recent-posts
widget_theysaidso_widget
personal_opts
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Personal Newsletter
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲8414.35 ▲0.401.77 ▼0.0641.22 ▼0.59
Dashboard /wp-admin2,229 ▲525.60 ▼0.0291.45 ▼0.4141.86 ▼2.52
Posts /wp-admin/edit.php2,131 ▲311.99 ▼0.0334.07 ▼2.6032.71 ▼4.98
Add New Post /wp-admin/post-new.php1,552 ▲2623.35 ▲0.28685.12 ▲21.0854.97 ▲4.77
Media Library /wp-admin/upload.php1,431 ▲314.17 ▲0.01101.45 ▼6.8643.71 ▼3.57
Añadir nueva /wp-admin/admin.php?page=personal-add-new1,0312.0525.2334.46
Campañas /wp-admin/admin.php?page=personal-campaigns1,0582.0025.6932.40

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/personal-newsletter/personal_newsletter.php+195
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_personal_newsletter
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • personal_opts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=personal-campaigns
    • > Deprecated in wp-content/plugins/personal-newsletter/personal_newsletter.php+195
    Function create_function() is deprecated
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=personal-campaigns
    • > Warning in wp-content/plugins/personal-newsletter/admin/admin.php+35
    Creating default object from empty value
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=personal-campaigns
    • > Notice in wp-content/plugins/personal-newsletter/admin/admin.php+40
    Undefined property: stdClass::$settings
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=personal-campaigns
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=personal-campaigns
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      require_once(): Failed opening required 'PERSONAL_INClist_table.php' (include_path='.:/usr/share/php') in wp-content/plugins/personal-newsletter/admin/admin.php on line 8
    • > PHP Warning
      Use of undefined constant PERSONAL_INC - assumed 'PERSONAL_INC' (this will throw an Error in a future version of PHP) in wp-content/plugins/personal-newsletter/admin/admin.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/personal-newsletter/include/list_table.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/personal-newsletter/personal_newsletter.php:69
    • > 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/personal-newsletter/include/list_table.php on line 8
    • > PHP Warning
      require_once(PERSONAL_INClist_table.php): failed to open stream: No such file or directory in wp-content/plugins/personal-newsletter/admin/admin.php on line 8
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/personal-newsletter/include/list_table.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Add images for these screenshots: #1 (Campaigns List page), #2 (Add new Campaign page), #3 (Profile edit page newsletter options)
  • Plugin Name: Please specify the plugin name on the first line ( === personal-newsletter === )
The official readme.txt is a good inspiration

personal-newsletter/personal_newsletter.php 92% from 13 tests

The principal PHP file in "Personal Newsletter" v. 0.0.1 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("personal-newsletter.php" instead of "personal_newsletter.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin580 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP5123264548
CSS25022
Markdown13010

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions26
▷ Named functions26100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.24MB with 0.14MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png87.29KB34.10KB▼ 60.93%
css/images/icons32.png14.31KB7.24KB▼ 49.36%
screenshot-3.png55.08KB21.68KB▼ 60.63%
screenshot-2.png89.06KB34.36KB▼ 61.41%