Skip to content

Commit 8ac29a1

Browse files
committed
Released 1.0.16
1 parent cd5ba08 commit 8ac29a1

File tree

16 files changed

+331
-28
lines changed

16 files changed

+331
-28
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ package-lock.json
88
.DS_Store
99
*.sublime-*
1010
translationStrings.php
11+
vendor
12+
fluent-smtp/*

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ All the email connection drivers can be found in `app/Services/Mailer/Providers`
5858

5959
![GitHub Contributors Image](https://contrib.rocks/image?repo=WPManageNinja/fluent-smtp)
6060

61+
#### Getting Started
62+
- Clone this repository.
63+
- Run `composer install` to install PHP dependencies.
6164

6265
#### Build JavaScript source
6366

app/Functions/helpers.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,6 @@ function fluentMailSend($to, $subject, $message, $headers = '', $attachments = a
474474
* This filter is documented in wp-includes/pluggable.php
475475
*
476476
* @param WP_Error $error A WP_Error object containing the error message.
477-
* @param array $mail_error_data An array of additional error data.
478477
* @return void
479478
*/
480479
do_action('wp_mail_failed', new WP_Error('wp_mail_failed', $e->getMessage(), $mail_error_data));

app/Hooks/Handlers/ActionsRegistrar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct(Application $app)
3535
*/
3636
public static function init(Application $app)
3737
{
38-
$instance = new static($app);
38+
$instance = new self($app);
3939
$instance->registerHooks();
4040
return $instance;
4141
}

app/Hooks/Handlers/AdminMenuHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public function enqueueAssets()
183183

184184
$user = get_user_by('ID', get_current_user_id());
185185

186-
$disable_recommendation = defined('DISALLOW_FILE_MODS') && DISALLOW_FILE_MODS;
186+
$disable_recommendation = wp_is_file_mod_allowed('install_plugins');
187187

188188
$settings = $this->getMailerSettings();
189189

app/Http/Controllers/SettingsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ public function installPlugin(Request $request)
318318
]
319319
];
320320

321-
if (!isset($UrlMaps[$pluginSlug]) || (defined('DISALLOW_FILE_MODS') && DISALLOW_FILE_MODS)) {
321+
if (!isset($UrlMaps[$pluginSlug]) || !wp_is_file_mod_allowed('install_plugins')) {
322322
$this->sendError([
323323
'message' => __('Sorry, You can not install this plugin', 'fluent-smtp')
324324
]);

app/Models/Model.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ class Model
77
protected $db = null;
88
protected $app = null;
99

10+
protected $table = null;
11+
1012
public function __construct()
1113
{
1214
$this->app = fluentMail();

app/Services/Mailer/Providers/ElasticMail/Handler.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -139,29 +139,6 @@ protected function getReplyTo()
139139
];
140140
}
141141

142-
protected function getRecipients()
143-
{
144-
$recipients = [
145-
'to' => $this->getTo(),
146-
'cc' => $this->getCarbonCopy(),
147-
'bcc' => $this->getBlindCarbonCopy(),
148-
];
149-
150-
$recipients = array_filter($recipients);
151-
152-
foreach ($recipients as $key => $recipient) {
153-
$array = array_map(function ($recipient) {
154-
return isset($recipient['name'])
155-
? $recipient['name'] . ' <' . $recipient['email'] . '>'
156-
: $recipient['email'];
157-
}, $recipient);
158-
159-
$this->attributes['formatted'][$key] = implode(', ', $array);
160-
}
161-
162-
return [$recipients];
163-
}
164-
165142
protected function getCcFormatted()
166143
{
167144
$ccs = $this->getCarbonCopy();

build.sh

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/bash
2+
3+
# Exit immediately if a command exits with a non-zero status
4+
set -e
5+
6+
echo "🚀 Starting Build Process..."
7+
8+
# 1. Build Frontend
9+
if [ -f "package.json" ]; then
10+
echo "📦 Building Frontend..."
11+
npx mix --production
12+
else
13+
echo "⚠️ package.json not found, skipping frontend build."
14+
fi
15+
16+
# 2. Optimize Backend (Remove Dev Dependencies)
17+
echo "🧹 Optimizing Composer for Production..."
18+
# Using --no-dev to remove phpstan etc.
19+
# Using --classmap-authoritative for maximum performance as discussed
20+
composer install --no-dev --optimize-autoloader --classmap-authoritative
21+
22+
# 3. Create Zip
23+
ZIP_NAME="fluent-smtp.zip"
24+
echo "🤐 Creating $ZIP_NAME..."
25+
26+
# Remove previous build if exists
27+
rm -f $ZIP_NAME
28+
29+
# Create the zip file excluding development files and folders
30+
# We use -r for recursive, and -x to exclude patterns
31+
zip -r $ZIP_NAME . \
32+
-x "*.git*" \
33+
-x "node_modules/*" \
34+
-x "tests/*" \
35+
-x "svn/*" \
36+
-x "resources/*" \
37+
-x "build.sh" \
38+
-x "phpstan.neon" \
39+
-x ".editorconfig" \
40+
-x ".eslintrc.js" \
41+
-x ".babelrc" \
42+
-x "webpack.config.js" \
43+
-x "translation.node.js" \
44+
-x "webpack.mix.js" \
45+
-x "package.json" \
46+
-x "package-lock.json" \
47+
-x "pnpm-lock.yaml" \
48+
-x "*.DS_Store" \
49+
-x ".gitignore" \
50+
-x ".gitattributes" \
51+
-x "composer.lock" \
52+
-x "README.md"
53+
54+
echo "✅ Build Created: $ZIP_NAME"
55+
56+
# 4. Restore Dev Dependencies
57+
echo "🔄 Restoring Dev Dependencies..."
58+
composer install
59+
60+
echo "🎉 Build Complete! You can now upload $ZIP_NAME to WordPress."

composer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,9 @@
2020
},
2121
"config": {
2222
"optimize-autoloader": true
23+
},
24+
"require-dev": {
25+
"phpstan/phpstan": "^2.1",
26+
"szepeviktor/phpstan-wordpress": "^2.0"
2327
}
2428
}

0 commit comments

Comments
 (0)