Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/aimogen-pro/res/aiomatic-csv-list.php
Keine Baseline-Datei – Diff nur gegen leer.
1
-
1
+
<?php
2
+
function aiomatic_csv_panel()
3
+
{
4
+
$all_rules = get_option('aiomatic_csv_list', array());
5
+
if($all_rules === false)
6
+
{
7
+
$all_rules = array();
8
+
}
9
+
$rules_count = count($all_rules);
10
+
$rules_per_page = get_option('aiomatic_posts_per_page', 12);
11
+
$max_pages = ceil($rules_count/$rules_per_page);
12
+
if($max_pages == 0)
13
+
{
14
+
$max_pages = 1;
15
+
}
16
+
$aiomatic_Main_Settings = get_option('aiomatic_Main_Settings', false);
17
+
if (!isset($aiomatic_Main_Settings['app_id']) || trim($aiomatic_Main_Settings['app_id']) == '')
18
+
{
19
+
?>
20
+
<h1><?php echo esc_html__("You must add an OpenAI/AiomaticAPI API Key into the plugin's 'Settings' menu before you can use this feature!", 'aiomatic-automatic-ai-content-writer');?></h1>
21
+
<?php
22
+
return;
23
+
}
24
+
?>
25
+
<div class="wp-header-end"></div>
26
+
<div class="wrap">
27
+
<h1><?php echo esc_html__("CSV AI Post Creator", 'aiomatic-automatic-ai-content-writer');?></h1>
28
+
</div>
29
+
<?php
30
+
$max_execution = ini_get('max_execution_time');
31
+
if($max_execution != 0 && $max_execution < 1000)
32
+
{
33
+
?>
34
+
<div class="notice notice-error">
35
+
<p class="cr_red">
36
+
<?php echo sprintf( wp_kses( __( "Warning! Your PHP INI max_execution_time is less than 1000 seconds (%s). This means that the plugin's execution will be forcefully stopped by your server after this amount of seconds. Please increase it to ensure that the plugin functions properly. Please check details on server settings, <a href='%s' target='_blank'>here</a>.", 'aiomatic-automatic-ai-content-writer'), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_html($max_execution), esc_url_raw( get_admin_url() . 'admin.php?page=aiomatic_logs#tab-2' ) );?>
37
+
</p>
38
+
</div>
39
+
<?php
40
+
}
41
+
?>
42
+
<div class="wrap gs_popuptype_holder seo_pops">
43
+
<div>
44
+
<form id="myForm" method="post" action="<?php echo esc_url((aiomatic_isSecure() ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");?>">
45
+
<?php
46
+
wp_nonce_field('aiomatic_save_rules', '_aiomaticr_nonce');
47
+
48
+
if (isset($_GET['settings-updated'])) {
49
+
?>
50
+
<div>
51
+
<p class="cr_saved_notif"><strong><?php echo esc_html__("Settings saved.", 'aiomatic-automatic-ai-content-writer');?></strong></p>
52
+
</div>
53
+
<?php
54
+
}
55
+
?>
56
+
<div>
57
+
<div class="hideMain">
58
+
<hr/>
59
+
<div class="table-responsive">
60
+
<table id="mainRules" class="responsive table cr_main_table">
61
+
<thead>
62
+
<tr>
63
+
<th class="cr_width_160">
64
+
<?php echo esc_html__("ID", 'aiomatic-automatic-ai-content-writer');?>
65
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
66
+
<div class="bws_hidden_help_text cr_min_260px">
67
+
<?php
68
+
echo esc_html__("This is the ID of the rule.", 'aiomatic-automatic-ai-content-writer');
69
+
?>
70
+
</div>
71
+
</div>
72
+
</th>
73
+
<th>
74
+
<span id="aiomatic_mode_title"><?php echo esc_html__("CSV File URLs List", 'aiomatic-automatic-ai-content-writer');?>*</span>
75
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
76
+
<div class="bws_hidden_help_text cr_min_260px">
77
+
<?php
78
+
echo esc_html__("Add the URLs of the CSV files from where the plugin will get the details for publishing posts. Add each file URL on a new line.", 'aiomatic-automatic-ai-content-writer');
79
+
?>
80
+
</div>
81
+
</div>
82
+
</th>
83
+
<th>
84
+
<?php echo esc_html__("Schedule", 'aiomatic-automatic-ai-content-writer');?>*
85
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
86
+
<div class="bws_hidden_help_text cr_min_260px">
87
+
<?php
88
+
$unlocker = get_option('aiomatic_minute_running_unlocked', false);
89
+
if($unlocker == '1')
90
+
{
91
+
echo esc_html__("Select the interval in minutes after which you want this rule to run. Defined in minutes.", 'aiomatic-automatic-ai-content-writer');
92
+
}
93
+
else
94
+
{
95
+
echo esc_html__("Select the interval in hours after which you want this rule to run. Defined in hours.", 'aiomatic-automatic-ai-content-writer');
96
+
}
97
+
?>
98
+
</div>
99
+
</div>
100
+
</th>
101
+
<th>
102
+
<?php echo esc_html__("# Of Posts", 'aiomatic-automatic-ai-content-writer');?>*
103
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
104
+
<div class="bws_hidden_help_text cr_min_260px">
105
+
<?php
106
+
echo esc_html__("Select the maximum number of posts that this rule can create at once.", 'aiomatic-automatic-ai-content-writer');
107
+
?>
108
+
</div>
109
+
</div>
110
+
</th>
111
+
<th>
112
+
<?php echo esc_html__("Options", 'aiomatic-automatic-ai-content-writer');?>
113
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
114
+
<div class="bws_hidden_help_text cr_min_260px">
115
+
<?php
116
+
echo esc_html__("Shows advanced settings for this rule.", 'aiomatic-automatic-ai-content-writer');
117
+
?>
118
+
</div>
119
+
</div>
120
+
</th>
121
+
<th class="cr_width_60">
122
+
<?php echo esc_html__("Delete", 'aiomatic-automatic-ai-content-writer');?>
123
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
124
+
<div class="bws_hidden_help_text cr_min_260px">
125
+
<?php
126
+
echo esc_html__("Do you want to delete this rule?", 'aiomatic-automatic-ai-content-writer');
127
+
?>
128
+
</div>
129
+
</div>
130
+
</th>
131
+
<th class="cr_width_60">
132
+
<?php echo esc_html__("Active", 'aiomatic-automatic-ai-content-writer');?>
133
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
134
+
<div class="bws_hidden_help_text cr_min_260px">
135
+
<?php
136
+
echo esc_html__("Do you want to enable this rule? You can deactivate any rule (you don't have to delete them to deactivate them).", 'aiomatic-automatic-ai-content-writer');
137
+
?>
138
+
</div>
139
+
</div>
140
+
<br/>
141
+
<input type="checkbox" onchange="thisonChangeHandler(this)" id="exclusion">
142
+
</th>
143
+
<th class="cr_width_160">
144
+
<?php echo esc_html__("Info", 'aiomatic-automatic-ai-content-writer');?>
145
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
146
+
<div class="bws_hidden_help_text cr_min_260px">
147
+
<?php
148
+
echo esc_html__("The number of items (posts, pages) this rule has generated so far.", 'aiomatic-automatic-ai-content-writer');
149
+
?>
150
+
</div>
151
+
</div>
152
+
</th>
153
+
<th class="cr_actions">
154
+
<?php echo esc_html__("Actions", 'aiomatic-automatic-ai-content-writer');?>
155
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
156
+
<div class="bws_hidden_help_text cr_min_260px">
157
+
<?php
158
+
echo esc_html__("Do you want to run this rule now? Note that only one instance of a rule is allowed at once.", 'aiomatic-automatic-ai-content-writer');
159
+
?>
160
+
</div>
161
+
</div>
162
+
</th>
163
+
</tr>
164
+
165
+
</thead>
166
+
<tbody>
167
+
<?php
168
+
echo aiomatic_expand_rules_csv();
169
+
if(isset($_GET['aiomatic_page']))
170
+
{
171
+
$current_page = $_GET['aiomatic_page'];
172
+
}
173
+
else
174
+
{
175
+
$current_page = '';
176
+
}
177
+
if($current_page == '' || (is_numeric($current_page) && $current_page == $max_pages))
178
+
{
179
+
?>
180
+
181
+
<tr>
182
+
<td class="cr_short_td"><input type="text" name="aiomatic_csv_list[rule_description][]" id="rule_description" class="cr_center" placeholder="Rule ID" value="" class="cr_width_full"/></td>
183
+
<td class="cr_loi"><textarea rows="1" name="aiomatic_csv_list[post_title][]" placeholder="CSV file URL" class="cr_width_full"></textarea></td>
184
+
<td class="cr_comm_td"><input type="number" step="1" min="1" name="aiomatic_csv_list[schedule][]" max="8765812" class="cr_width_60" placeholder="Select the rule schedule interval" value="24"/></td>
185
+
<td class="cr_comm_td"><input type="number" step="1" min="0" name="aiomatic_csv_list[max][]" class="cr_width_60" placeholder="Select the # of generated posts" value="1" /></td>
186
+
<td class="cr_width_70 cr_center">
187
+
<input type="button" id="mybtnfzr" value="Settings">
188
+
<div id="mymodalfzr" class="codemodalfzr">
189
+
<div class="codemodalfzr-content">
190
+
<div class="codemodalfzr-header">
191
+
<span id="aiomatic_close" class="codeclosefzr">×</span>
192
+
<h2><span class="cr_color_white"><?php echo esc_html__("New Rule", 'aiomatic-automatic-ai-content-writer');?></span> <?php echo esc_html__("Advanced Settings", 'aiomatic-automatic-ai-content-writer');?></h2>
193
+
</div>
194
+
<div class="codemodalfzr-body">
195
+
<div class="table-responsive">
196
+
<table class="responsive table cr_main_table_nowr">
197
+
<tr><td colspan="2">
198
+
<h3><?php echo esc_html__("CSV File Options", 'aiomatic-automatic-ai-content-writer');?>:</h3>
199
+
</td></tr>
200
+
<tr>
201
+
<td>
202
+
<div>
203
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
204
+
<div class="bws_hidden_help_text cr_min_260px">
205
+
<?php
206
+
echo esc_html__("Set the separator of the CSV file. It is usually auto detected, however, if you have issues with auto detection, you can set the CSV separator here.", 'aiomatic-automatic-ai-content-writer');
207
+
?>
208
+
</div>
209
+
</div>
210
+
<b><?php echo esc_html__("CSV File Separator (Optional):", 'aiomatic-automatic-ai-content-writer');?></b>
211
+
</td>
212
+
<td>
213
+
<input type="text"class="cr_width_full" name="aiomatic_csv_list[csv_separator][]" value="" placeholder="Optional, leave empty if not sure" class="cr_width_full">
214
+
</td>
215
+
</tr>
216
+
<tr><td colspan="2">
217
+
<h3><?php echo esc_html__("Posting Options", 'aiomatic-automatic-ai-content-writer');?>:</h3>
218
+
</td></tr>
219
+
<tr>
220
+
<td>
221
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
222
+
<div class="bws_hidden_help_text cr_min_260px">
223
+
<?php
224
+
echo esc_html__("The AI writer might add the title of the post to the created post content. Check this checkbox if you want to remove the title from the post content.", 'aiomatic-automatic-ai-content-writer');
225
+
?>
226
+
</div>
227
+
</div>
228
+
<b><?php echo esc_html__("Strip Title From Content:", 'aiomatic-automatic-ai-content-writer');?></b>
229
+
</td>
230
+
<td>
231
+
<input type="checkbox" id="strip_title" name="aiomatic_csv_list[strip_title][]">
232
+
</td>
233
+
</tr>
234
+
<tr>
235
+
<td>
236
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
237
+
<div class="bws_hidden_help_text cr_min_260px"><?php echo esc_html__("Do you want to skip spinning of posts generated by this rule?", 'aiomatic-automatic-ai-content-writer');?>
238
+
</div>
239
+
</div>
240
+
<b><?php echo esc_html__("Do Not Spin Posts Generated By This Rule:", 'aiomatic-automatic-ai-content-writer');?></b>
241
+
</td>
242
+
<td>
243
+
<input type="checkbox" id="skip_spin" name="aiomatic_csv_list[skip_spin][]">
244
+
</td>
245
+
</tr>
246
+
<tr>
247
+
<td>
248
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
249
+
<div class="bws_hidden_help_text cr_min_260px"><?php echo esc_html__("Do you want to skip translating of posts generated by this rule?", 'aiomatic-automatic-ai-content-writer');?>
250
+
</div>
251
+
</div>
252
+
<b><?php echo esc_html__("Do Not Translate Posts Generated By This Rule:", 'aiomatic-automatic-ai-content-writer');?></b>
253
+
</td>
254
+
<td>
255
+
<input type="checkbox" id="skip_translate" name="aiomatic_csv_list[skip_translate][]">
256
+
</td>
257
+
</tr>
258
+
<tr>
259
+
<td>
260
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
261
+
<div class="bws_hidden_help_text cr_min_260px">
262
+
<?php
263
+
echo esc_html__("Do you want to randomize CSV row processing order or do you want to process the lines in their order of appearence?", 'aiomatic-automatic-ai-content-writer');
264
+
?>
265
+
</div>
266
+
</div>
267
+
<b><?php echo esc_html__("Randomize CSV Row Processing Order:", 'aiomatic-automatic-ai-content-writer');?></b>
268
+
</td>
269
+
<td>
270
+
<input type="checkbox" id="random_order" name="aiomatic_csv_list[random_order][]">
271
+
</td>
272
+
</tr>
273
+
<tr>
274
+
<td>
275
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
276
+
<div class="bws_hidden_help_text cr_min_260px">
277
+
<?php
278
+
echo esc_html__("Select if you want to process each title from the added list only once.", 'aiomatic-automatic-ai-content-writer');
279
+
?>
280
+
</div>
281
+
</div>
282
+
<b><?php echo esc_html__("Process Each Title/Topic Only Once:", 'aiomatic-automatic-ai-content-writer');?></b>
283
+
</td>
284
+
<td>
285
+
<input type="checkbox" id="title_once" name="aiomatic_csv_list[title_once][]" checked>
286
+
</td>
287
+
</tr>
288
+
<tr>
289
+
<td>
290
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
291
+
<div class="bws_hidden_help_text cr_min_260px">
292
+
<?php
293
+
echo esc_html__("Select if you want to overwrite existing posts during the publishing process.", 'aiomatic-automatic-ai-content-writer');
294
+
?>
295
+
</div>
296
+
</div>
297
+
<b><?php echo esc_html__("Overwrite Existing Posts:", 'aiomatic-automatic-ai-content-writer');?></b>
298
+
</td>
299
+
<td>
300
+
<input type="checkbox" id="overwrite_existing" name="aiomatic_csv_list[overwrite_existing][]">
301
+
</td>
302
+
</tr>
303
+
<tr>
304
+
<td>
305
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
306
+
<div class="bws_hidden_help_text cr_min_260px">
307
+
<?php
308
+
echo esc_html__("Run regex on post content. To disable this feature, leave this field blank. No Regex separators are required here. You can add multiple Regex expressions, each on a different line.", 'aiomatic-automatic-ai-content-writer');
309
+
?>
310
+
</div>
311
+
</div>
312
+
<b><?php echo esc_html__("Run Regex On Content:", 'aiomatic-automatic-ai-content-writer');?></b>
313
+
</td>
314
+
<td>
315
+
<textarea rows="1" class="cr_width_full" name="aiomatic_csv_list[strip_by_regex][]" placeholder="regex expression" class="cr_width_full"></textarea>
316
+
</td>
317
+
</tr>
318
+
<tr>
319
+
<td>
320
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
321
+
<div class="bws_hidden_help_text cr_min_260px">
322
+
<?php
323
+
echo esc_html__("Replace the above regex matches with this regex expression. If you want to strip matched content, leave this field blank. No Regex separators are required here. You can add multiple replacement expressions, each on a different line.", 'aiomatic-automatic-ai-content-writer');
324
+
?>
325
+
</div>
326
+
</div>
327
+
<b><?php echo esc_html__("Replace Matches From Regex (Content):", 'aiomatic-automatic-ai-content-writer');?></b>
328
+
</td>
329
+
<td>
330
+
<textarea rows="1" class="cr_width_full" name="aiomatic_csv_list[replace_regex][]" placeholder="regex replacement" class="cr_width_full"></textarea>
331
+
</td>
332
+
</tr>
333
+
<tr>
334
+
<td>
335
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
336
+
<div class="bws_hidden_help_text cr_min_260px">
337
+
<?php
338
+
echo esc_html__("Select the author that you want to assign for the automatically generated posts. The author can also be set in the CSV file, using the post_author column.", 'aiomatic-automatic-ai-content-writer');
339
+
?>
340
+
</div>
341
+
</div>
342
+
<b><?php echo esc_html__("Post Author:", 'aiomatic-automatic-ai-content-writer');?></b>
343
+
</td>
344
+
<td class="cr_min_width_200">
345
+
<select autocomplete="off" id="post_author" name="aiomatic_csv_list[post_author][]" class="cr_width_full">
346
+
<option value="rand"><?php echo esc_html__("Random user", 'aiomatic-automatic-ai-content-writer');?></option>
347
+
<?php
348
+
$blogusers = get_users( [ 'role__in' => [ 'contributor', 'author', 'editor', 'administrator' ] ] );
349
+
foreach ($blogusers as $user) {
350
+
echo '<option value="' . esc_html($user->ID) . '"';
351
+
echo '>' . esc_html($user->display_name) . '</option>';
352
+
}
353
+
?>
354
+
</select>
355
+
</td>
356
+
</tr>
357
+
<tr>
358
+
<td>
359
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
360
+
<div class="bws_hidden_help_text cr_min_260px">
361
+
<?php
362
+
echo esc_html__("Select the status that you want for the automatically generated posts to have.", 'aiomatic-automatic-ai-content-writer');
363
+
?>
364
+
</div>
365
+
</div>
366
+
<b><?php echo esc_html__("Post Status:", 'aiomatic-automatic-ai-content-writer');?></b>
367
+
</td>
368
+
<td class="cr_min_width_200">
369
+
<select autocomplete="off" id="submit_status" name="aiomatic_csv_list[submit_status][]" class="cr_width_full">
370
+
<option value="pending"><?php echo esc_html__("Pending -> Moderate", 'aiomatic-automatic-ai-content-writer');?></option>
371
+
<option value="draft"><?php echo esc_html__("Draft -> Moderate", 'aiomatic-automatic-ai-content-writer');?></option>
372
+
<option value="publish" selected><?php echo esc_html__("Published", 'aiomatic-automatic-ai-content-writer');?></option>
373
+
<option value="private"><?php echo esc_html__("Private", 'aiomatic-automatic-ai-content-writer');?></option>
374
+
<option value="trash"><?php echo esc_html__("Trash", 'aiomatic-automatic-ai-content-writer');?></option>
375
+
</select>
376
+
</td>
377
+
</tr>
378
+
<tr>
379
+
<td>
380
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
381
+
<div class="bws_hidden_help_text cr_min_260px">
382
+
<?php
383
+
echo esc_html__("Select the type (post/page) for your automatically generated item.", 'aiomatic-automatic-ai-content-writer');
384
+
?>
385
+
</div>
386
+
</div>
387
+
<b><?php echo esc_html__("Item Type:", 'aiomatic-automatic-ai-content-writer');?></b>
388
+
</td>
389
+
<td class="cr_min_width_200">
390
+
<select autocomplete="off" id="default_type" name="aiomatic_csv_list[default_type][]" class="cr_width_full">
391
+
<?php
392
+
$is_first = true;
393
+
foreach ( get_post_types( '', 'names' ) as $post_type ) {
394
+
if(strstr($post_type, 'aiomatic_'))
395
+
{
396
+
continue;
397
+
}
398
+
echo '<option value="' . esc_attr($post_type) . '"';
399
+
if($is_first === true)
400
+
{
401
+
echo ' selected';
402
+
$is_first = false;
403
+
}
404
+
echo '>' . esc_html($post_type) . '</option>';
405
+
}
406
+
?>
407
+
</select>
408
+
</td>
409
+
</tr>
410
+
<tr>
411
+
<td>
412
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
413
+
<div class="bws_hidden_help_text cr_min_260px">
414
+
<?php
415
+
echo esc_html__("If your template supports 'Post Formats', than you can select one here. If not, leave this at it's default value.", 'aiomatic-automatic-ai-content-writer');
416
+
?>
417
+
</div>
418
+
</div>
419
+
<b><?php echo esc_html__("Generated Post Format:", 'aiomatic-automatic-ai-content-writer');?></b>
420
+
</td>
421
+
<td class="cr_min_width_200">
422
+
<select autocomplete="off" id="post_format" name="aiomatic_csv_list[post_format][]" class="cr_width_full">
423
+
<option value="post-format-standard" selected><?php echo esc_html__("Standard", 'aiomatic-automatic-ai-content-writer');?></option>
424
+
<option value="post-format-aside"><?php echo esc_html__("Aside", 'aiomatic-automatic-ai-content-writer');?></option>
425
+
<option value="post-format-gallery"><?php echo esc_html__("Gallery", 'aiomatic-automatic-ai-content-writer');?></option>
426
+
<option value="post-format-link"><?php echo esc_html__("Link", 'aiomatic-automatic-ai-content-writer');?></option>
427
+
<option value="post-format-image"><?php echo esc_html__("Image", 'aiomatic-automatic-ai-content-writer');?></option>
428
+
<option value="post-format-quote"><?php echo esc_html__("Quote", 'aiomatic-automatic-ai-content-writer');?></option>
429
+
<option value="post-format-status"><?php echo esc_html__("Status", 'aiomatic-automatic-ai-content-writer');?></option>
430
+
<option value="post-format-video"><?php echo esc_html__("Video", 'aiomatic-automatic-ai-content-writer');?></option>
431
+
<option value="post-format-audio"><?php echo esc_html__("Audio", 'aiomatic-automatic-ai-content-writer');?></option>
432
+
<option value="post-format-chat"><?php echo esc_html__("Chat", 'aiomatic-automatic-ai-content-writer');?></option>
433
+
</select>
434
+
</td>
435
+
</tr>
436
+
<tr>
437
+
<td>
438
+
<div>
439
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
440
+
<div class="bws_hidden_help_text cr_min_260px">
441
+
<?php
442
+
echo esc_html__("Set the ID of the parent of created posts. This is useful for BBPress integration, to assign forum IDs for created topics or for other similar functionalities.", 'aiomatic-automatic-ai-content-writer');
443
+
?>
444
+
</div>
445
+
</div>
446
+
<b><?php echo esc_html__("Post Parent ID:", 'aiomatic-automatic-ai-content-writer');?></b>
447
+
</td>
448
+
<td>
449
+
<input type="number" min="1" class="cr_width_full" name="aiomatic_csv_list[parent_id][]" value="" placeholder="Post parent ID" class="cr_width_full">
450
+
</td>
451
+
</tr>
452
+
<tr>
453
+
<td>
454
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
455
+
<div class="bws_hidden_help_text cr_min_260px">
456
+
<?php
457
+
echo esc_html__("This feature will try to remove the WordPress's default post category. This may fail in case no additional categories are added, because WordPress requires at least one post category for every post.", 'aiomatic-automatic-ai-content-writer');
458
+
?>
459
+
</div>
460
+
</div>
461
+
<b><?php echo esc_html__("Remove WP Default Post Category:", 'aiomatic-automatic-ai-content-writer');?></b>
462
+
</td>
463
+
<td>
464
+
<input type="checkbox" id="remove_default" name="aiomatic_csv_list[remove_default][]" checked>
465
+
</td>
466
+
</tr>
467
+
<tr>
468
+
<td>
469
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
470
+
<div class="bws_hidden_help_text cr_min_260px">
471
+
<?php
472
+
echo esc_html__("Do you want to enable comments for the generated posts?", 'aiomatic-automatic-ai-content-writer');
473
+
?>
474
+
</div>
475
+
</div>
476
+
<b><?php echo esc_html__("Enable Comments For Posts:", 'aiomatic-automatic-ai-content-writer');?></b>
477
+
</td>
478
+
<td>
479
+
<input type="checkbox" id="enable_comments" name="aiomatic_csv_list[enable_comments][]" checked>
480
+
</td>
481
+
</tr>
482
+
<tr>
483
+
<td>
484
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
485
+
<div class="bws_hidden_help_text cr_min_260px">
486
+
<?php
487
+
echo esc_html__("Do you want to enable pingbacks/trackbacks for the generated posts?", 'aiomatic-automatic-ai-content-writer');
488
+
?>
489
+
</div>
490
+
</div>
491
+
<b><?php echo esc_html__("Enable Pingback/Trackback:", 'aiomatic-automatic-ai-content-writer');?></b>
492
+
</td>
493
+
<td>
494
+
<input type="checkbox" id="enable_pingback" name="aiomatic_csv_list[enable_pingback][]" checked>
495
+
</td>
496
+
</tr>
497
+
<tr>
498
+
<td>
499
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
500
+
<div class="bws_hidden_help_text cr_min_260px">
501
+
<?php
502
+
echo sprintf( wp_kses( __( "Do you want to set a custom post publish date for posts? Set the range in the below field Accepted values for this field are listed: <a href='%s' target='_blank'>here</a>. To disable this feature, leave this field blank.", 'aiomatic-automatic-ai-content-writer'), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url_raw( 'https://www.php.net/manual/en/datetime.formats.php' ) );
503
+
?>
504
+
</div>
505
+
</div>
506
+
<b><?php echo esc_html__("Set a Custom Post Publish Date Range:", 'aiomatic-automatic-ai-content-writer');?></b>
507
+
</td>
508
+
<td>
509
+
<input type="text" id="min_time" name="aiomatic_csv_list[min_time][]" placeholder="Start time" class="cr_half"> - <input type="text" id="max_time" name="aiomatic_csv_list[max_time][]" placeholder="End time" class="cr_half">
510
+
</td>
511
+
</tr>
512
+
<tr>
513
+
<td class="cr_min_width_200">
514
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
515
+
<div class="bws_hidden_help_text_top cr_min_260px">
516
+
<?php
517
+
echo esc_html__("Set the custom fields that will be set for generated posts. The syntax for this field is the following: custom_field_name1 => custom_field_value1, custom_field_name2 => custom_field_value2, ... . You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators. You can also use the following topic based shortcodes: %%post_title%%, %%random_sentence%%, %%post_original_title%%, %%random_sentence2%%, %%blog_title%%", 'aiomatic-automatic-ai-content-writer');
518
+
?>
519
+
</div>
520
+
</div>
521
+
<b><?php echo esc_html__("Post Custom Fields:", 'aiomatic-automatic-ai-content-writer');?></b> <b><a href="https://coderevolution.ro/knowledge-base/faq/post-template-reference-advanced-usage/" target="_blank">ⓘ</a></b>
522
+
</td>
523
+
<td>
524
+
<textarea rows="1" cols="70" name="aiomatic_csv_list[custom_fields][]" placeholder="Please insert your desired custom fields. Example: title_custom_field => %%post_title%%" class="cr_width_full"></textarea>
525
+
</td>
526
+
</tr>
527
+
<tr>
528
+
<td class="cr_min_width_200">
529
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
530
+
<div class="bws_hidden_help_text_top cr_min_260px">
531
+
<?php
532
+
echo esc_html__("Set the custom taxonomies that will be set for generated posts. The syntax for this field is the following: custom_taxonomy_name1 => custom_taxonomy_value1A, custom_taxonomy_value1B; custom_taxonomy_name2 => custom_taxonomy_value2A, custom_taxonomy_value2B; ... . You can also set hierarhical taxonomies (parent > child), in this format: custom_taxonomy_name => parent1 > child1 . You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators. You can also use the following topic based shortcodes: %%post_title%%, %%random_sentence%%, %%post_original_title%%, %%random_sentence2%%, %%blog_title%%", 'aiomatic-automatic-ai-content-writer');
533
+
?>
534
+
</div>
535
+
</div>
536
+
<b><?php echo esc_html__("Post Custom Taxonomies:", 'aiomatic-automatic-ai-content-writer');?></b> <b><a href="https://coderevolution.ro/knowledge-base/faq/post-template-reference-advanced-usage/" target="_blank">ⓘ</a></b>
537
+
</td>
538
+
<td>
539
+
<textarea rows="1" cols="70" name="aiomatic_csv_list[custom_tax][]" placeholder="Please insert your desired custom taxonomies. Example: custom_taxonomy_name => %%post_title%%" class="cr_width_full"></textarea>
540
+
</td>
541
+
</tr>
542
+
<tr>
543
+
<td>
544
+
<div>
545
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
546
+
<div class="bws_hidden_help_text_top cr_min_260px">
547
+
<?php
548
+
echo esc_html__("Enter a 2 letter language code that will be assigned as the WPML/Polylang language for posts. Example: for German, input: de", 'aiomatic-automatic-ai-content-writer');
549
+
?>
550
+
</div>
551
+
</div>
552
+
<b><?php echo esc_html__("Assign WPML/Polylang Language to Posts:", 'aiomatic-automatic-ai-content-writer');?></b>
553
+
</td>
554
+
<td>
555
+
<input type="text" class="cr_width_full" name="aiomatic_csv_list[wpml_lang][]" value="" placeholder="WPML/Polylang language" class="cr_width_full">
556
+
</td>
557
+
</tr>
558
+
<tr><td colspan="2">
559
+
<h3><?php echo esc_html__("Automatic Linking Options", 'aiomatic-automatic-ai-content-writer');?>:</h3>
560
+
</td></tr>
561
+
<tr>
562
+
<td>
563
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
564
+
<div class="bws_hidden_help_text cr_min_260px">
565
+
<?php
566
+
echo esc_html__("Select the linking method to use in posts.", 'aiomatic-automatic-ai-content-writer');
567
+
?>
568
+
</div>
569
+
</div>
570
+
<b><?php echo esc_html__("Automatic Linking Type:", 'aiomatic-automatic-ai-content-writer');?></b>
571
+
</td>
572
+
<td>
573
+
<select autocomplete="off" class="cr_width_full" id="link_type" onchange="hideLinks('');" name="aiomatic_csv_list[link_type][]">
574
+
<option value="disabled" selected><?php echo esc_html__("Disabled", 'aiomatic-automatic-ai-content-writer');?></option>
575
+
<option value="internal"><?php echo esc_html__("Internal Links", 'aiomatic-automatic-ai-content-writer');?></option>
576
+
<option value="manual"><?php echo esc_html__("Manual Links", 'aiomatic-automatic-ai-content-writer');?></option>
577
+
<option value="serp"><?php echo esc_html__("Related SERP Links", 'aiomatic-automatic-ai-content-writer');?></option>
578
+
<option value="mixed"><?php echo esc_html__("Internal + Manual Links", 'aiomatic-automatic-ai-content-writer');?></option>
579
+
<option value="intserp"><?php echo esc_html__("Internal & SERP Links", 'aiomatic-automatic-ai-content-writer');?></option>
580
+
<option value="manserp"><?php echo esc_html__("Manual & SERP Links", 'aiomatic-automatic-ai-content-writer');?></option>
581
+
<option value="intmanserp"><?php echo esc_html__("Internal & Manual & SERP Links", 'aiomatic-automatic-ai-content-writer');?></option>
582
+
</select>
583
+
</td>
584
+
</tr>
585
+
<tr>
586
+
<td class="cr_min_width_200">
587
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
588
+
<div class="bws_hidden_help_text cr_min_260px">
589
+
<?php
590
+
echo esc_html__("Set the maximum number of automatic links to add to created posts. You can also define custom ranges, like: 3-5. Please note that this feature will work best if you already have a considerable number of posts published on your site, which will be used for internal linking.", 'aiomatic-automatic-ai-content-writer');
591
+
?>
592
+
</div>
593
+
</div>
594
+
<b><?php echo esc_html__("Maximum Number Of Automatic Links To Add To The Post Content:", 'aiomatic-automatic-ai-content-writer');?></b>
595
+
</td>
596
+
<td>
597
+
<input type="text" name="aiomatic_csv_list[max_links][]" placeholder="Add the number of links to enable this feature" class="cr_width_full">
598
+
</td>
599
+
</tr>
600
+
<tr class="hidelinks">
601
+
<td class="cr_min_width_200">
602
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
603
+
<div class="bws_hidden_help_text cr_min_260px">
604
+
<?php
605
+
echo esc_html__("Enter a manual list of links, where the plugin will create links.", 'aiomatic-automatic-ai-content-writer');
606
+
?>
607
+
</div>
608
+
</div>
609
+
<b><?php echo esc_html__("Manual List Of URLs (One Per Line):", 'aiomatic-automatic-ai-content-writer');?></b>
610
+
</td>
611
+
<td>
612
+
<textarea rows="1" cols="70" name="aiomatic_csv_list[link_list][]" placeholder="URL list (one per line)" class="cr_width_full"></textarea>
613
+
</td>
614
+
</tr>
615
+
<tr class="hidelinks">
616
+
<td class="cr_min_width_200">
617
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
618
+
<div class="bws_hidden_help_text cr_min_260px">
619
+
<?php
620
+
echo esc_html__("Do you want to add nofollow attribute to manually entered, external links?", 'aiomatic-automatic-ai-content-writer');
621
+
?>
622
+
</div>
623
+
</div>
624
+
<b><?php echo esc_html__("Add Nofollow Attribute To External Links:", 'aiomatic-automatic-ai-content-writer');?></b>
625
+
</td>
626
+
<td>
627
+
<input type="checkbox" id="link_nofollow" name="aiomatic_csv_list[link_nofollow][]">
628
+
</td>
629
+
</tr>
630
+
<tr>
631
+
<td class="cr_min_width_200">
632
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
633
+
<div class="bws_hidden_help_text cr_min_260px">
634
+
<?php
635
+
echo esc_html__("Set the post types where to create automatic links in posts. You can also add a comma separated list of multiple post types.", 'aiomatic-automatic-ai-content-writer');
636
+
?>
637
+
</div>
638
+
</div>
639
+
<b><?php echo esc_html__("Post Types Where To Generate Automatic Links:", 'aiomatic-automatic-ai-content-writer');?></b>
640
+
</td>
641
+
<td>
642
+
<input type="text" name="aiomatic_csv_list[link_post_types][]" placeholder="post" class="cr_width_full">
643
+
</td>
644
+
</tr>
645
+
<tr><td colspan="2">
646
+
<h3><?php echo esc_html__("Scheduling Restrictions", 'aiomatic-automatic-ai-content-writer');?>:</h3>
647
+
</td></tr>
648
+
<tr>
649
+
<td class="cr_min_width_200">
650
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
651
+
<div class="bws_hidden_help_text cr_min_260px">
652
+
<?php
653
+
echo esc_html__("Select the days of the week when you don't want to run this rule. You can enter a comma separate list of day names.", 'aiomatic-automatic-ai-content-writer');
654
+
?>
655
+
</div>
656
+
</div>
657
+
<b><?php echo esc_html__("Do Not Run This Rule On The Following Days Of The Week:", 'aiomatic-automatic-ai-content-writer');?></b>
658
+
<br/><?php echo esc_html__("Current Server Time:", 'aiomatic-automatic-ai-content-writer') . ' ' . esc_html(date('l', time())) . ', ' . esc_html(date("Y-m-d H:i:s"));?>
659
+
</td>
660
+
<td>
661
+
<input type="text" class="cr_width_full" name="aiomatic_csv_list[days_no_run][]" value="" placeholder="Mo,Tu,We,Th,Fr,Sa,Su" class="cr_width_full">
662
+
</td>
663
+
</tr>
664
+
</table>
665
+
</div>
666
+
</div>
667
+
<div class="codemodalfzr-footer">
668
+
<br/>
669
+
<h3 class="cr_inline">Aimogen Automatic Post Generator</h3>
670
+
<span id="aiomatic_ok" class="codeokfzr cr_inline">OK </span>
671
+
<br/><br/>
672
+
</div>
673
+
</div>
674
+
</div>
675
+
</td>
676
+
<td class="cr_shrt_td2"><span class="cr_gray20">X</span></td>
677
+
<td class="cr_short_td"><input type="checkbox" name="aiomatic_csv_list[active][]" value="1" checked />
678
+
<input type="hidden" name="aiomatic_csv_list[last_run][]" value="1988-01-27 00:00:00"/>
679
+
<input type="hidden" name="aiomatic_csv_list[rule_unique_id][]" value="<?php echo esc_html(uniqid('', true));?>"/>
680
+
</td>
681
+
<td class="cr_short_td">
682
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
683
+
<div class="bws_hidden_help_text cr_min_260px">
684
+
<?php
685
+
echo esc_html__("No info.", 'aiomatic-automatic-ai-content-writer');
686
+
?>
687
+
</div>
688
+
</div>
689
+
</td>
690
+
<td class="cr_center">
691
+
<div>
692
+
<img src="<?php
693
+
echo esc_url_raw(plugin_dir_url(dirname(__FILE__)) . 'images/running.gif');
694
+
?>" alt="Running" class="cr_running">
695
+
<div class="codemainfzr cr_gray_back cr_width_80p">
696
+
<select autocomplete="off" class="codemainfzr" id="actions" class="actions" name="actions" disabled>
697
+
<option value="select" disabled selected><?php echo esc_html__("Select an Action", 'aiomatic-automatic-ai-content-writer');?></option>
698
+
<option value="run" onclick=""><?php echo esc_html__("Run This Rule Now", 'aiomatic-automatic-ai-content-writer');?></option>
699
+
<option value="duplicate" onclick=""><?php echo esc_html__("Duplicate This Rule", 'aiomatic-automatic-ai-content-writer');?></option>
700
+
<option value="up" onclick=""><?php echo esc_html__("Move This Rule Up", 'aiomatic-automatic-ai-content-writer');?></option>
701
+
<option value="down" onclick=""><?php echo esc_html__("Move This Rule Down", 'aiomatic-automatic-ai-content-writer');?></option>
702
+
<option value="trash" onclick=""><?php echo esc_html__("Send All Posts To Trash", 'aiomatic-automatic-ai-content-writer');?></option>
703
+
<option value="delete" onclick=""><?php echo esc_html__("Permanently Delete All Posts", 'aiomatic-automatic-ai-content-writer');?></option>
704
+
</select>
705
+
</div>
706
+
</div>
707
+
</td>
708
+
</tr>
709
+
<?php
710
+
}
711
+
?>
712
+
</tbody>
713
+
</table>
714
+
</div>
715
+
</div>
716
+
</div>
717
+
<hr/>
718
+
719
+
<div>
720
+
<?php
721
+
$next_url = (aiomatic_isSecure() ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
722
+
if(stristr($next_url, 'aiomatic_page=') === false)
723
+
{
724
+
if(stristr($next_url, '?') === false)
725
+
{
726
+
if($max_pages == 1)
727
+
{
728
+
$next_url .= '?aiomatic_page=1';
729
+
}
730
+
else
731
+
{
732
+
$next_url .= '?aiomatic_page=2';
733
+
}
734
+
}
735
+
else
736
+
{
737
+
if($max_pages == 1)
738
+
{
739
+
$next_url .= '&aiomatic_page=1';
740
+
}
741
+
else
742
+
{
743
+
$next_url .= '&aiomatic_page=2';
744
+
}
745
+
}
746
+
}
747
+
else
748
+
{
749
+
if(isset($_GET['aiomatic_page']))
750
+
{
751
+
$curent_page = $_GET["aiomatic_page"];
752
+
}
753
+
else
754
+
{
755
+
$curent_page = '';
756
+
}
757
+
if(is_numeric($curent_page))
758
+
{
759
+
$next_page = $curent_page + 1;
760
+
if($next_page > $max_pages)
761
+
{
762
+
$next_page = $max_pages;
763
+
}
764
+
if($next_page <= 0)
765
+
{
766
+
$next_page = 1;
767
+
}
768
+
$next_url = str_replace('aiomatic_page=' . $curent_page, 'aiomatic_page=' . $next_page, $next_url);
769
+
}
770
+
else
771
+
{
772
+
if(stristr($next_url, '?') === false)
773
+
{
774
+
if($max_pages == 1)
775
+
{
776
+
$next_url .= '?aiomatic_page=1';
777
+
}
778
+
else
779
+
{
780
+
$next_url .= '?aiomatic_page=2';
781
+
}
782
+
}
783
+
else
784
+
{
785
+
if($max_pages == 1)
786
+
{
787
+
$next_url .= '&aiomatic_page=1';
788
+
}
789
+
else
790
+
{
791
+
$next_url .= '&aiomatic_page=2';
792
+
}
793
+
}
794
+
}
795
+
}
796
+
$prev_url = (aiomatic_isSecure() ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
797
+
if(stristr($prev_url, 'aiomatic_page=') === false)
798
+
{
799
+
if(stristr($prev_url, '?') === false)
800
+
{
801
+
$prev_url .= '?aiomatic_page=1';
802
+
}
803
+
else
804
+
{
805
+
$prev_url .= '&aiomatic_page=1';
806
+
}
807
+
}
808
+
else
809
+
{
810
+
if(isset($_GET['aiomatic_page']))
811
+
{
812
+
$curent_page = $_GET["aiomatic_page"];
813
+
}
814
+
else
815
+
{
816
+
$curent_page = '';
817
+
}
818
+
if(is_numeric($curent_page))
819
+
{
820
+
$go_to = $curent_page - 1;
821
+
if($go_to <= 0)
822
+
{
823
+
$go_to = 1;
824
+
}
825
+
if($go_to > $max_pages)
826
+
{
827
+
$go_to = $max_pages;
828
+
}
829
+
$prev_url = str_replace('aiomatic_page=' . $curent_page, 'aiomatic_page=' . $go_to, $prev_url);
830
+
}
831
+
else
832
+
{
833
+
if(stristr($prev_url, '?') === false)
834
+
{
835
+
$prev_url .= '?aiomatic_page=1';
836
+
}
837
+
else
838
+
{
839
+
$prev_url .= '&aiomatic_page=1';
840
+
}
841
+
}
842
+
}
843
+
$first_url = (aiomatic_isSecure() ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
844
+
if(stristr($first_url, 'aiomatic_page=') === false)
845
+
{
846
+
if(stristr($first_url, '?') === false)
847
+
{
848
+
$first_url .= '?aiomatic_page=1';
849
+
}
850
+
else
851
+
{
852
+
$first_url .= '&aiomatic_page=1';
853
+
}
854
+
}
855
+
else
856
+
{
857
+
if(isset($_GET['aiomatic_page']))
858
+
{
859
+
$curent_page = $_GET["aiomatic_page"];
860
+
}
861
+
else
862
+
{
863
+
$curent_page = '';
864
+
}
865
+
if(is_numeric($curent_page))
866
+
{
867
+
$first_url = str_replace('aiomatic_page=' . $curent_page, 'aiomatic_page=1', $first_url);
868
+
}
869
+
else
870
+
{
871
+
if(stristr($first_url, '?') === false)
872
+
{
873
+
$first_url .= '?aiomatic_page=1';
874
+
}
875
+
else
876
+
{
877
+
$first_url .= '&aiomatic_page=1';
878
+
}
879
+
}
880
+
}
881
+
$last_url = (aiomatic_isSecure() ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
882
+
if(stristr($last_url, 'aiomatic_page=') === false)
883
+
{
884
+
if(stristr($last_url, '?') === false)
885
+
{
886
+
$last_url .= '?aiomatic_page=' . $max_pages;
887
+
}
888
+
else
889
+
{
890
+
$last_url .= '&aiomatic_page=' . $max_pages;
891
+
}
892
+
}
893
+
else
894
+
{
895
+
if(isset($_GET['aiomatic_page']))
896
+
{
897
+
$curent_page = $_GET["aiomatic_page"];
898
+
}
899
+
else
900
+
{
901
+
$curent_page = '';
902
+
}
903
+
if(is_numeric($curent_page))
904
+
{
905
+
$last_url = str_replace('aiomatic_page=' . $curent_page, 'aiomatic_page=' . $max_pages, $last_url);
906
+
}
907
+
else
908
+
{
909
+
if(stristr($last_url, '?') === false)
910
+
{
911
+
$last_url .= '?aiomatic_page=' . $max_pages;
912
+
}
913
+
else
914
+
{
915
+
$last_url .= '&aiomatic_page=' . $max_pages;
916
+
}
917
+
}
918
+
}
919
+
if(isset($_GET['aiomatic_page']))
920
+
{
921
+
$this_page = $_GET["aiomatic_page"];
922
+
}
923
+
else
924
+
{
925
+
$this_page = '1';
926
+
}
927
+
echo '<center><a href="' . esc_url_raw($first_url) . '">' . esc_html__('First Page', 'aiomatic-automatic-ai-content-writer') . '</a> <a href="' . esc_url_raw($prev_url) . '">' . esc_html__('Previous Page', 'aiomatic-automatic-ai-content-writer') . '</a> ' . esc_html__('Page', 'aiomatic-automatic-ai-content-writer') . ' ' . esc_html($this_page) . ' ' . esc_html__('of', 'aiomatic-automatic-ai-content-writer') . ' ' . esc_html($max_pages) . ' - ' . esc_html__("Rules Per Page:", 'aiomatic-automatic-ai-content-writer') . ' <input class="cr_50" type="number" min="2" step="1" max="999" name="posts_per_page" value="' . esc_attr($rules_per_page). '" required/> <a href="' . esc_url_raw($next_url) . '">' . esc_html__('Next Page', 'aiomatic-automatic-ai-content-writer') . '</a> <a href="' . esc_url_raw($last_url) . '">' . esc_html__('Last Page', 'aiomatic-automatic-ai-content-writer') . '</a></center>
928
+
<center></center>
929
+
<center>Info: You can add new rules only on the last page.</center>';
930
+
?>
931
+
<br/><?php echo esc_html__("Check some example CSV files you can use:", 'aiomatic-automatic-ai-content-writer') . "<ul><li><a href='https://coderevolution.ro/csv/upload.csv' target='_blank'>" . esc_html__("CSV example file 1 (basic functionality)", 'aiomatic-automatic-ai-content-writer') . "</a></li><li><a href='https://coderevolution.ro/csv/advanced.csv' target='_blank'>" . esc_html__("CSV example file 2 (advanced file with some additional variables)", 'aiomatic-automatic-ai-content-writer') . "</a></li><li><a href='https://coderevolution.ro/csv/nested.csv' target='_blank'>" . esc_html__("CSV example file 3 (advanced file with nested [aicontent] shortcodes", 'aiomatic-automatic-ai-content-writer') . "</a></li></ul><b>" . esc_html__("You can also use Google Drive for CSV file storage:", 'aiomatic-automatic-ai-content-writer') . "</b><ul><li><a href='https://youtu.be/D1ruPVbOTpw' target='_blank'>" . esc_html__("Tutorial video: how to use CSV files upload to Google Drive", 'aiomatic-automatic-ai-content-writer') . "</a></li></ul>";?><br/>
932
+
<div>
933
+
<p class="crsubmit"><input type="submit" name="btnSubmit" id="btnSubmit" class="button button-primary" onclick="unsaved = false;" value="<?php echo esc_html__("Save Settings", 'aiomatic-automatic-ai-content-writer');?>"/></p>
934
+
</div>
935
+
<div>
936
+
<div><?php echo esc_html__("* = required", 'aiomatic-automatic-ai-content-writer');?></div><br/><?php echo sprintf( wp_kses( __( "Check more settings which apply to rule running, over at the plugin's 'Settings' menu, <a href='%s' target='_blank'>here</a>.", 'aiomatic-automatic-ai-content-writer'), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url_raw( get_admin_url() . 'admin.php?page=aiomatic_admin_settings#tab-17' ) );?>
937
+
<br/><?php echo esc_html__("New! You can use the [aicontent]Your Prompt[/aicontent] shortcode in this or other", 'aiomatic-automatic-ai-content-writer') . " <a href='https://wpbay.com/store/coderevolution/' target='_blank'>" . esc_html__("'omatic plugins created by CodeRevolution", 'aiomatic-automatic-ai-content-writer') . "</a>" . esc_html__(", click for details:", 'aiomatic-automatic-ai-content-writer');?> <a href="https://coderevolution.ro/knowledge-base/faq/how-to-create-ai-generated-content-from-any-plugin-built-by-coderevolution/" target="_blank"><img src="https://i.ibb.co/WGQ1rtF/ai.webp" alt="artificial-intelligence-badge" title="AI content generator support, when used together with the Aimogen plugin"></a><br/><br/><a href="https://www.youtube.com/watch?v=5rbnu_uis7Y" target="_blank"><?php echo esc_html__("Nested Shortcodes also supported!", 'aiomatic-automatic-ai-content-writer');?></a><br/><br/><?php echo esc_html__("Confused about rule running status icons?", 'aiomatic-automatic-ai-content-writer');?> <a href="http://coderevolution.ro/knowledge-base/faq/how-to-interpret-the-rule-running-visual-indicators-red-x-yellow-diamond-green-tick-from-inside-plugins/" target="_blank"><?php echo esc_html__("More info", 'aiomatic-automatic-ai-content-writer');?></a><br/>
938
+
<div class="cr_none" id="midas_icons">
939
+
<table>
940
+
<tr>
941
+
<td><img id="run_img" src="<?php echo esc_url_raw(plugin_dir_url(dirname(__FILE__)) . 'images/running.gif');?>" alt="Running" title="status"></td>
942
+
<td><?php echo esc_html__("In Progress", 'aiomatic-automatic-ai-content-writer');?> - <b><?php echo esc_html__("Importing is Running", 'aiomatic-automatic-ai-content-writer');?></b></td>
943
+
</tr>
944
+
<tr>
945
+
<td><img id="ok_img" src="<?php echo esc_url_raw(plugin_dir_url(dirname(__FILE__)) . 'images/ok.gif');?>" alt="OK" title="status"></td>
946
+
<td><?php echo esc_html__("Success", 'aiomatic-automatic-ai-content-writer');?> - <b><?php echo esc_html__("New Posts Created", 'aiomatic-automatic-ai-content-writer');?></b></td>
947
+
</tr>
948
+
<tr>
949
+
<td><img id="fail_img" src="<?php echo esc_url_raw(plugin_dir_url(dirname(__FILE__)) . 'images/failed.gif');?>" alt="Faield" title="status"></td>
950
+
<td><?php echo esc_html__("Failed", 'aiomatic-automatic-ai-content-writer');?> - <b><?php echo esc_html__("An Error Occurred.", 'aiomatic-automatic-ai-content-writer');?> <b><?php echo esc_html__("Please check 'Activity and Logging' plugin menu for details.", 'aiomatic-automatic-ai-content-writer');?></b></td>
951
+
</tr>
952
+
<tr>
953
+
<td><img id="nochange_img" src="<?php echo esc_url_raw(plugin_dir_url(dirname(__FILE__)) . 'images/nochange.gif');?>" alt="NoChange" title="status"></td>
954
+
<td><?php echo esc_html__("No Change - No New Posts Created", 'aiomatic-automatic-ai-content-writer');?> - <b><?php echo esc_html__("Possible reasons:", 'aiomatic-automatic-ai-content-writer');?></b></td>
955
+
</tr>
956
+
<tr>
957
+
<td></td>
958
+
<td>
959
+
<ul>
960
+
<li>► <?php echo esc_html__("Please change rule settings, as your titles are all posted.", 'aiomatic-automatic-ai-content-writer');?></li>
961
+
</ul>
962
+
</td>
963
+
</tr>
964
+
</table>
965
+
</div>
966
+
</div>
967
+
</form>
968
+
</div>
969
+
<div id="running_status_ai"></div>
970
+
</div>
971
+
<?php if(!isset($aiomatic_Main_Settings['hide_videos']) || trim($aiomatic_Main_Settings['hide_videos']) != 'on'){
972
+
?>
973
+
<div class="wrap">
974
+
<h3><?php echo esc_html__("CSV AI Post Creator Tutorial Video", 'aiomatic-automatic-ai-content-writer');?></h3>
975
+
<div id="ai-video-container"><br/>
976
+
<iframe class="ai-video" width="560" height="315" src="https://www.youtube.com/embed/3ZhuTt81F58" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
977
+
</div>
978
+
</div>
979
+
<?php
980
+
}
981
+
}
982
+
if (isset($_POST['aiomatic_csv_list'])) {
983
+
add_action('admin_init', 'aiomatic_save_rules_csv');
984
+
}
985
+
986
+
function aiomatic_save_rules_csv($data2)
987
+
{
988
+
$init_rules_per_page = get_option('aiomatic_posts_per_page', 12);
989
+
$rules_per_page = get_option('aiomatic_posts_per_page', 12);
990
+
if(isset($_POST['posts_per_page']))
991
+
{
992
+
aiomatic_update_option('aiomatic_posts_per_page', $_POST['posts_per_page']);
993
+
}
994
+
check_admin_referer('aiomatic_save_rules', '_aiomaticr_nonce');
995
+
996
+
$data2 = $_POST['aiomatic_csv_list'];
997
+
$rules = get_option('aiomatic_csv_list', array());
998
+
if(!is_array($rules))
999
+
{
1000
+
$rules = array();
1001
+
}
1002
+
$initial_count = count($rules);
1003
+
$add = false;
1004
+
$scad = false;
1005
+
if(isset($_GET["aiomatic_page"]) && is_numeric($_GET["aiomatic_page"]))
1006
+
{
1007
+
$curent_page = $_GET["aiomatic_page"];
1008
+
}
1009
+
else
1010
+
{
1011
+
$curent_page = 1;
1012
+
}
1013
+
$offset = ($curent_page - 1) * $rules_per_page;
1014
+
$cat_cont = $offset;
1015
+
$cont = 0;
1016
+
if (isset($data2['post_title'][0])) {
1017
+
for ($i = 0; $i < sizeof($data2['post_title']); ++$i)
1018
+
{
1019
+
$bundle = array();
1020
+
if (isset($data2['schedule'][$i]) && $data2['schedule'][$i] != '' && $data2['post_title'][$i] != '') {
1021
+
$bundle[] = trim(sanitize_text_field($data2['schedule'][$i]));
1022
+
if (isset($data2['active'][$i])) {
1023
+
$bundle[] = trim(sanitize_text_field($data2['active'][$i]));
1024
+
} else {
1025
+
$bundle[] = '0';
1026
+
}
1027
+
$bundle[] = trim(sanitize_text_field($data2['last_run'][$i]));
1028
+
$bundle[] = trim(sanitize_text_field($data2['max'][$i]));
1029
+
$bundle[] = trim(sanitize_text_field($data2['submit_status'][$i]));
1030
+
$bundle[] = trim(sanitize_text_field($data2['default_type'][$i]));
1031
+
$bundle[] = trim(sanitize_text_field($data2['post_author'][$i]));
1032
+
$bundle[] = trim(sanitize_text_field($data2['enable_comments'][$i]));
1033
+
$bundle[] = $data2['post_title'][$i];
1034
+
$bundle[] = trim(sanitize_text_field($data2['enable_pingback'][$i]));
1035
+
$bundle[] = trim(sanitize_text_field($data2['post_format'][$i]));
1036
+
$bundle[] = trim($data2['custom_fields'][$i]);
1037
+
$bundle[] = trim($data2['custom_tax'][$i]);
1038
+
$bundle[] = trim($data2['wpml_lang'][$i]);
1039
+
$bundle[] = trim($data2['strip_title'][$i]);
1040
+
$bundle[] = trim($data2['title_once'][$i]);
1041
+
$bundle[] = trim($data2['min_time'][$i]);
1042
+
$bundle[] = trim($data2['max_time'][$i]);
1043
+
$bundle[] = trim($data2['skip_spin'][$i]);
1044
+
$bundle[] = trim($data2['skip_translate'][$i]);
1045
+
$bundle[] = trim($data2['rule_description'][$i]);
1046
+
$bundle[] = trim($data2['strip_by_regex'][$i]);
1047
+
$bundle[] = trim($data2['replace_regex'][$i]);
1048
+
$bundle[] = trim($data2['max_links'][$i]);
1049
+
$bundle[] = trim($data2['link_post_types'][$i]);
1050
+
$bundle[] = trim($data2['link_type'][$i]);
1051
+
$bundle[] = trim($data2['link_list'][$i]);
1052
+
$bundle[] = trim($data2['days_no_run'][$i]);
1053
+
$bundle[] = trim($data2['overwrite_existing'][$i]);
1054
+
$bundle[] = trim($data2['link_nofollow'][$i]);
1055
+
$bundle[] = trim($data2['parent_id'][$i]);
1056
+
$bundle[] = trim($data2['rule_unique_id'][$i]);
1057
+
$bundle[] = trim($data2['remove_default'][$i]);
1058
+
$bundle[] = trim($data2['random_order'][$i]);
1059
+
$bundle[] = trim($data2['csv_separator'][$i]);
1060
+
$rules[$offset + $cont] = $bundle;
1061
+
$cont++;
1062
+
$cat_cont++;
1063
+
}
1064
+
}
1065
+
while($cont < $init_rules_per_page)
1066
+
{
1067
+
if(isset($rules[$offset + $cont]))
1068
+
{
1069
+
$rules[$offset + $cont] = false;
1070
+
}
1071
+
$cont = $cont + 1;
1072
+
$cat_cont++;
1073
+
}
1074
+
$rules = array_values(array_filter($rules));
1075
+
}
1076
+
$final_count = count($rules);
1077
+
if($final_count > $initial_count)
1078
+
{
1079
+
$add = true;
1080
+
}
1081
+
elseif($final_count < $initial_count)
1082
+
{
1083
+
$scad = true;
1084
+
}
1085
+
aiomatic_update_option('aiomatic_csv_list', $rules, false);
1086
+
if(count($rules) % $rules_per_page === 1 && $add === true)
1087
+
{
1088
+
$rules_count = count($rules);
1089
+
$max_pages = ceil($rules_count/$rules_per_page);
1090
+
if($max_pages == 0)
1091
+
{
1092
+
$max_pages = 1;
1093
+
}
1094
+
$last_url = (aiomatic_isSecure() ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
1095
+
if(stristr($last_url, 'aiomatic_page=') === false)
1096
+
{
1097
+
if(stristr($last_url, '?') === false)
1098
+
{
1099
+
$last_url .= '?aiomatic_page=' . $max_pages;
1100
+
}
1101
+
else
1102
+
{
1103
+
$last_url .= '&aiomatic_page=' . $max_pages;
1104
+
}
1105
+
}
1106
+
else
1107
+
{
1108
+
if(isset($_GET['aiomatic_page']))
1109
+
{
1110
+
$curent_page = $_GET["aiomatic_page"];
1111
+
}
1112
+
else
1113
+
{
1114
+
$curent_page = '';
1115
+
}
1116
+
if(is_numeric($curent_page))
1117
+
{
1118
+
$last_url = str_replace('aiomatic_page=' . $curent_page, 'aiomatic_page=' . $max_pages, $last_url);
1119
+
}
1120
+
else
1121
+
{
1122
+
if(stristr($last_url, '?') === false)
1123
+
{
1124
+
$last_url .= '?aiomatic_page=' . $max_pages;
1125
+
}
1126
+
else
1127
+
{
1128
+
$last_url .= '&aiomatic_page=' . $max_pages;
1129
+
}
1130
+
}
1131
+
}
1132
+
aiomatic_redirect($last_url);
1133
+
}
1134
+
elseif(count($rules) != 0 && count($rules) % $rules_per_page === 0 && $scad === true)
1135
+
{
1136
+
$rules_count = count($rules);
1137
+
$max_pages = ceil($rules_count/$rules_per_page);
1138
+
if($max_pages == 0)
1139
+
{
1140
+
$max_pages = 1;
1141
+
}
1142
+
$last_url = (aiomatic_isSecure() ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
1143
+
if(stristr($last_url, 'aiomatic_page=') === false)
1144
+
{
1145
+
if(stristr($last_url, '?') === false)
1146
+
{
1147
+
$last_url .= '?aiomatic_page=' . $max_pages;
1148
+
}
1149
+
else
1150
+
{
1151
+
$last_url .= '&aiomatic_page=' . $max_pages;
1152
+
}
1153
+
}
1154
+
else
1155
+
{
1156
+
if(isset($_GET['aiomatic_page']))
1157
+
{
1158
+
$curent_page = $_GET["aiomatic_page"];
1159
+
}
1160
+
else
1161
+
{
1162
+
$curent_page = '';
1163
+
}
1164
+
if(is_numeric($curent_page))
1165
+
{
1166
+
$last_url = str_replace('aiomatic_page=' . $curent_page, 'aiomatic_page=' . $max_pages, $last_url);
1167
+
}
1168
+
else
1169
+
{
1170
+
if(stristr($last_url, '?') === false)
1171
+
{
1172
+
$last_url .= '?aiomatic_page=' . $max_pages;
1173
+
}
1174
+
else
1175
+
{
1176
+
$last_url .= '&aiomatic_page=' . $max_pages;
1177
+
}
1178
+
}
1179
+
}
1180
+
aiomatic_redirect($last_url);
1181
+
}
1182
+
}
1183
+
function aiomatic_expand_rules_csv()
1184
+
{
1185
+
if (!get_option('aiomatic_running_list')) {
1186
+
$running = array();
1187
+
} else {
1188
+
$running = get_option('aiomatic_running_list');
1189
+
}
1190
+
$GLOBALS['wp_object_cache']->delete('aiomatic_csv_list', 'options');
1191
+
$rules = get_option('aiomatic_csv_list');
1192
+
if(!is_array($rules))
1193
+
{
1194
+
$rules = array();
1195
+
}
1196
+
$output = '';
1197
+
$cont = 0;
1198
+
if (!empty($rules)) {
1199
+
$cat_args = array(
1200
+
"orderby" => "name",
1201
+
"hide_empty" => 0,
1202
+
"order" => "ASC"
1203
+
);
1204
+
global $wpdb;
1205
+
$post_statuses = array(
1206
+
'publish',
1207
+
'draft',
1208
+
'pending',
1209
+
'trash',
1210
+
'private',
1211
+
'future'
1212
+
);
1213
+
$post_statuses_in = "'" . implode("','", $post_statuses) . "'";
1214
+
$sql = "
1215
+
SELECT pm.meta_value AS rule_id, COUNT(*) AS rule_count
1216
+
FROM {$wpdb->posts} p
1217
+
INNER JOIN {$wpdb->postmeta} pm ON (p.ID = pm.post_id)
1218
+
WHERE p.post_status IN ($post_statuses_in)
1219
+
AND pm.meta_key = 'aiomatic_parent_rule'
1220
+
GROUP BY pm.meta_value
1221
+
";
1222
+
$results = $wpdb->get_results($sql);
1223
+
$counted_vals = array();
1224
+
if ( ! empty($results) ) {
1225
+
foreach ($results as $row) {
1226
+
$ruleKey = (string)$row->rule_id;
1227
+
if (strpos($ruleKey, '-') !== false) {
1228
+
$exp = explode('-', $ruleKey);
1229
+
if (isset($exp[0]) && isset($exp[1]) && $exp[0] === '0') {
1230
+
$ruleKey = $exp[1];
1231
+
}
1232
+
}
1233
+
$counted_vals[$ruleKey] = $row->rule_count;
1234
+
}
1235
+
}
1236
+
if(isset($_GET["aiomatic_page"]) && is_numeric($_GET["aiomatic_page"]))
1237
+
{
1238
+
$curent_page = $_GET["aiomatic_page"];
1239
+
}
1240
+
else
1241
+
{
1242
+
$curent_page = 1;
1243
+
}
1244
+
$unlocker = get_option('aiomatic_minute_running_unlocked', false);
1245
+
$rules_per_page = get_option('aiomatic_posts_per_page', 12);
1246
+
foreach ($rules as $request => $bundle[]) {
1247
+
if(($cont < ($curent_page - 1) * $rules_per_page) || ($cont >= $curent_page * $rules_per_page))
1248
+
{
1249
+
$cont++;
1250
+
continue;
1251
+
}
1252
+
$bundle_values = array_values($bundle);
1253
+
$myValues = $bundle_values[$cont];
1254
+
$array_my_values = array_values($myValues);for($iji=0;$iji<count($array_my_values);++$iji){if(is_string($array_my_values[$iji])){$array_my_values[$iji]=stripslashes($array_my_values[$iji]);}}
1255
+
$schedule = $array_my_values[0];
1256
+
$active = $array_my_values[1];
1257
+
$last_run = $array_my_values[2];
1258
+
$max = $array_my_values[3];
1259
+
$status = $array_my_values[4];
1260
+
$def_type = $array_my_values[5];
1261
+
$post_user_name = $array_my_values[6];
1262
+
$enable_comments = $array_my_values[7];
1263
+
$post_title = $array_my_values[8];
1264
+
$enable_pingback = $array_my_values[9];
1265
+
$post_format = $array_my_values[10];
1266
+
$custom_fields = $array_my_values[11];
1267
+
$custom_tax = $array_my_values[12];
1268
+
$wpml_lang = $array_my_values[13];
1269
+
$strip_title = $array_my_values[14];
1270
+
$title_once = $array_my_values[15];
1271
+
$min_time = $array_my_values[16];
1272
+
$max_time = $array_my_values[17];
1273
+
$skip_spin = $array_my_values[18];
1274
+
$skip_translate = $array_my_values[19];
1275
+
$rule_description = $array_my_values[20];
1276
+
$strip_by_regex = $array_my_values[21];
1277
+
$replace_regex = $array_my_values[22];
1278
+
$max_links = $array_my_values[23];
1279
+
$link_post_types = $array_my_values[24];
1280
+
$link_type = $array_my_values[25];
1281
+
$link_list = $array_my_values[26];
1282
+
$days_no_run = $array_my_values[27];
1283
+
$overwrite_existing = $array_my_values[28];
1284
+
$link_nofollow = $array_my_values[29];
1285
+
$parent_id = $array_my_values[30];
1286
+
$rule_unique_id = $array_my_values[31];
1287
+
$remove_default = $array_my_values[32];
1288
+
$random_order = $array_my_values[33];
1289
+
$csv_separator = $array_my_values[34];
1290
+
if(empty($rule_unique_id))
1291
+
{
1292
+
$rule_unique_id = $cont;
1293
+
}
1294
+
if (isset($counted_vals[$rule_unique_id])) {
1295
+
$generated_posts = $counted_vals[$rule_unique_id];
1296
+
} else {
1297
+
$generated_posts = 0;
1298
+
}
1299
+
if($rule_description == '')
1300
+
{
1301
+
$rule_description = $cont;
1302
+
}
1303
+
$name = md5(get_bloginfo());
1304
+
wp_add_inline_script($name . '-footer-script', 'createAdmin(' . esc_html($cont) . ');createModeSelect(' . esc_html($cont) . ');hideLinks(' . esc_html($cont) . ');', 'after');
1305
+
$output .= '<tr>
1306
+
<td class="cr_short_td"><input type="text" name="aiomatic_csv_list[rule_description][]" id="rule_description' . esc_html($cont) . '" class="cr_center" placeholder="Rule ID" value="' . esc_html($rule_description) . '" class="cr_width_full"/></td>
1307
+
<td class="cr_loi"><textarea rows="1" name="aiomatic_csv_list[post_title][]" placeholder="CSV file URL" class="cr_width_full">' . htmlspecialchars($post_title) . '</textarea></td>
1308
+
<td class="cr_comm_td"><input type="number" step="1" min="1" placeholder="# h" name="aiomatic_csv_list[schedule][]" max="8765812" value="' . esc_attr($schedule) . '" class="cr_width_60" required></td>
1309
+
<td class="cr_comm_td"><input type="number" step="1" min="0" placeholder="#" name="aiomatic_csv_list[max][]" value="' . esc_attr($max) . '" class="cr_width_60" required></td>
1310
+
<td class="cr_width_70 cr_center">
1311
+
<input type="button" id="mybtnfzr' . esc_html($cont) . '" value="Settings">
1312
+
<div id="mymodalfzr' . esc_html($cont) . '" class="codemodalfzr">
1313
+
<div class="codemodalfzr-content">
1314
+
<div class="codemodalfzr-header">
1315
+
<span id="aiomatic_close' . esc_html($cont) . '" class="codeclosefzr">×</span>
1316
+
<h2>' . esc_html__('Rule', 'aiomatic-automatic-ai-content-writer') . ' <span class="cr_color_white">ID ' . esc_html($cont) . '</span> ' . esc_html__('Advanced Settings', 'aiomatic-automatic-ai-content-writer') . '</h2>
1317
+
</div>
1318
+
<div class="codemodalfzr-body">
1319
+
<div class="table-responsive">
1320
+
<table class="responsive table cr_main_table_nowr">
1321
+
<tr><td colspan="2"><h3>' . esc_html__('CSV File Options', 'aiomatic-automatic-ai-content-writer') . ':</h3></td></tr>
1322
+
<tr><td>
1323
+
<div>
1324
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1325
+
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Set the separator of the CSV file. It is usually auto detected, however, if you have issues with auto detection, you can set the CSV separator here.", 'aiomatic-automatic-ai-content-writer') . '
1326
+
</div>
1327
+
</div>
1328
+
<b>' . esc_html__("CSV File Separator (Optional)", 'aiomatic-automatic-ai-content-writer') . ':</b>
1329
+
1330
+
</td><td>
1331
+
<input type="text" class="cr_width_full" name="aiomatic_csv_list[csv_separator][]" value="' . esc_attr($csv_separator) . '" placeholder="Optional, leave empty if not sure" class="cr_width_full">
1332
+
1333
+
</div>
1334
+
</td></tr>
1335
+
<tr><td colspan="2"><h3>' . esc_html__('Posting Options', 'aiomatic-automatic-ai-content-writer') . ':</h3></td></tr>
1336
+
<tr><td>
1337
+
<div>
1338
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1339
+
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("The AI writer might add the title of the post to the created post content. Check this checkbox if you want to remove the title from the post content", 'aiomatic-automatic-ai-content-writer') . '
1340
+
</div>
1341
+
</div>
1342
+
<b>' . esc_html__("Strip Title From Content", 'aiomatic-automatic-ai-content-writer') . ':</b>
1343
+
1344
+
</td><td>
1345
+
<input type="checkbox" id="strip_title' . esc_html($cont) . '" name="aiomatic_csv_list[strip_title][]"';
1346
+
if($strip_title == '1')
1347
+
{
1348
+
$output .= ' checked';
1349
+
}
1350
+
$output .= '>
1351
+
1352
+
</div>
1353
+
</td></tr><tr><td>
1354
+
<div>
1355
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1356
+
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Do you want to skip spinning of posts generated by this rule?", 'aiomatic-automatic-ai-content-writer') . '
1357
+
</div>
1358
+
</div>
1359
+
<b>' . esc_html__("Do Not Spin Posts Generated By This Rule", 'aiomatic-automatic-ai-content-writer') . ':</b>
1360
+
1361
+
</td><td>
1362
+
<input type="checkbox" id="skip_spin' . esc_html($cont) . '" name="aiomatic_csv_list[skip_spin][]"';
1363
+
if($skip_spin == '1')
1364
+
{
1365
+
$output .= ' checked';
1366
+
}
1367
+
$output .= '>
1368
+
</div>
1369
+
</td></tr><tr><td>
1370
+
<div>
1371
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1372
+
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Do you want to skip translating of posts generated by this rule?", 'aiomatic-automatic-ai-content-writer') . '
1373
+
</div>
1374
+
</div>
1375
+
<b>' . esc_html__("Do Not Translate Posts Generated By This Rule", 'aiomatic-automatic-ai-content-writer') . ':</b>
1376
+
1377
+
</td><td>
1378
+
<input type="checkbox" id="skip_translate' . esc_html($cont) . '" name="aiomatic_csv_list[skip_translate][]"';
1379
+
if($skip_translate == '1')
1380
+
{
1381
+
$output .= ' checked';
1382
+
}
1383
+
$output .= '>
1384
+
</div>
1385
+
</td></tr><tr><td>
1386
+
<div>
1387
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1388
+
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Do you want to randomize CSV row processing order or do you want to process the lines in their order of appearence?", 'aiomatic-automatic-ai-content-writer') . '
1389
+
</div>
1390
+
</div>
1391
+
<b>' . esc_html__("Randomize CSV Row Processing Order", 'aiomatic-automatic-ai-content-writer') . ':</b>
1392
+
1393
+
</td><td>
1394
+
<input type="checkbox" id="random_order' . esc_html($cont) . '" name="aiomatic_csv_list[random_order][]"';
1395
+
if($random_order == '1')
1396
+
{
1397
+
$output .= ' checked';
1398
+
}
1399
+
$output .= '>
1400
+
1401
+
</div>
1402
+
</td></tr><tr><td>
1403
+
<div>
1404
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1405
+
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Select if you want to process each title from the added list only once.", 'aiomatic-automatic-ai-content-writer') . '
1406
+
</div>
1407
+
</div>
1408
+
<b>' . esc_html__("Process Each Title/Topic Only Once", 'aiomatic-automatic-ai-content-writer') . ':</b>
1409
+
1410
+
</td><td>
1411
+
<input type="checkbox" id="title_once' . esc_html($cont) . '" name="aiomatic_csv_list[title_once][]"';
1412
+
if($title_once == '1')
1413
+
{
1414
+
$output .= ' checked';
1415
+
}
1416
+
$output .= '>
1417
+
1418
+
</div>
1419
+
</td></tr><tr><td>
1420
+
<div>
1421
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1422
+
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Select if you want to overwrite existing posts during the publishing process.", 'aiomatic-automatic-ai-content-writer') . '
1423
+
</div>
1424
+
</div>
1425
+
<b>' . esc_html__("Overwrite Existing Posts", 'aiomatic-automatic-ai-content-writer') . ':</b>
1426
+
1427
+
</td><td>
1428
+
<input type="checkbox" id="overwrite_existing' . esc_html($cont) . '" name="aiomatic_csv_list[overwrite_existing][]"';
1429
+
if($overwrite_existing == '1')
1430
+
{
1431
+
$output .= ' checked';
1432
+
}
1433
+
$output .= '>
1434
+
1435
+
</div>
1436
+
</td></tr><tr><td>
1437
+
<div>
1438
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1439
+
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Run regex on post content. To disable this feature, leave this field blank. No Regex separators are required here. You can add multiple Regex expressions, each on a different line.", 'aiomatic-automatic-ai-content-writer') . '
1440
+
</div>
1441
+
</div>
1442
+
<b>' . esc_html__("Run Regex On Content", 'aiomatic-automatic-ai-content-writer') . ':</b>
1443
+
1444
+
</td><td>
1445
+
<textarea rows="1" class="cr_width_full" name="aiomatic_csv_list[strip_by_regex][]" placeholder="regex" class="cr_width_full">' . esc_textarea($strip_by_regex) . '</textarea>
1446
+
1447
+
</div>
1448
+
</td></tr><tr><td>
1449
+
<div>
1450
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1451
+
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Replace the above regex matches with this regex expression. If you want to strip matched content, leave this field blank. No Regex separators are required here. You can add multiple replacement expressions, each on a different line.", 'aiomatic-automatic-ai-content-writer') . '
1452
+
</div>
1453
+
</div>
1454
+
<b>' . esc_html__("Replace Matches From Regex (Content)", 'aiomatic-automatic-ai-content-writer') . ':</b>
1455
+
1456
+
</td><td>
1457
+
<textarea rows="1" class="cr_width_full" name="aiomatic_csv_list[replace_regex][]" placeholder="regex replacement" class="cr_width_full">' . esc_textarea($replace_regex) . '</textarea>
1458
+
1459
+
</div>
1460
+
</td></tr><tr><td>
1461
+
<div>
1462
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1463
+
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Select the author that you want to assign for the automatically generated posts. The author can also be set in the CSV file, using the post_author column.", 'aiomatic-automatic-ai-content-writer') . '
1464
+
</div>
1465
+
</div>
1466
+
<b>' . esc_html__("Post Author", 'aiomatic-automatic-ai-content-writer') . ':</b>
1467
+
</td><td class="cr_min_width_200">
1468
+
<select autocomplete="off" id="post_author' . esc_html($cont) . '" name="aiomatic_csv_list[post_author][]" class="cr_width_full">';
1469
+
$output .= '<option value="rand"';
1470
+
if ($post_user_name == "rand") {
1471
+
$output .= " selected";
1472
+
}
1473
+
$output .= '>' . esc_html__("Random user", 'aiomatic-automatic-ai-content-writer') . '</option>';
1474
+
$blogusers = get_users( [ 'role__in' => [ 'contributor', 'author', 'editor', 'administrator' ] ] );
1475
+
foreach ($blogusers as $user) {
1476
+
$output .= '<option value="' . esc_html($user->ID) . '"';
1477
+
if ($post_user_name == $user->ID) {
1478
+
$output .= " selected";
1479
+
}
1480
+
$output .= '>' . esc_html($user->display_name) . '</option>';
1481
+
}
1482
+
$output .= '</select>
1483
+
</div>
1484
+
</td></tr><tr><td>
1485
+
<div>
1486
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1487
+
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Select the status that you want for the automatically generated posts to have.", 'aiomatic-automatic-ai-content-writer') . '
1488
+
</div>
1489
+
</div>
1490
+
<b>' . esc_html__("Post Status", 'aiomatic-automatic-ai-content-writer') . ':</b>
1491
+
</td><td class="cr_min_width_200">
1492
+
<select autocomplete="off" id="submit_status' . esc_html($cont) . '" name="aiomatic_csv_list[submit_status][]" class="cr_width_full">
1493
+
<option value="pending"';
1494
+
if ($status == 'pending') {
1495
+
$output .= ' selected';
1496
+
}
1497
+
$output .= '>' . esc_html__("Pending -> Moderate", 'aiomatic-automatic-ai-content-writer') . '</option>
1498
+
<option value="draft"';
1499
+
if ($status == 'draft') {
1500
+
$output .= ' selected';
1501
+
}
1502
+
$output .= '>' . esc_html__("Draft -> Moderate", 'aiomatic-automatic-ai-content-writer') . '</option>
1503
+
<option value="publish"';
1504
+
if ($status == 'publish') {
1505
+
$output .= ' selected';
1506
+
}
1507
+
$output .= '>' . esc_html__("Published", 'aiomatic-automatic-ai-content-writer') . '</option>
1508
+
<option value="private"';
1509
+
if ($status == 'private') {
1510
+
$output .= ' selected';
1511
+
}
1512
+
$output .= '>' . esc_html__("Private", 'aiomatic-automatic-ai-content-writer') . '</option>
1513
+
<option value="trash"';
1514
+
if ($status == 'trash') {
1515
+
$output .= ' selected';
1516
+
}
1517
+
$output .= '>' . esc_html__("Trash", 'aiomatic-automatic-ai-content-writer') . '</option>
1518
+
</select>
1519
+
</div>
1520
+
</td></tr><tr><td>
1521
+
<div>
1522
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1523
+
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Select the type (post/page) for your automatically generated item.", 'aiomatic-automatic-ai-content-writer') . '
1524
+
</div>
1525
+
</div>
1526
+
<b>' . esc_html__("Item Type", 'aiomatic-automatic-ai-content-writer') . ':</b>
1527
+
</td><td class="cr_min_width_200">
1528
+
<select autocomplete="off" id="default_type' . esc_html($cont) . '" name="aiomatic_csv_list[default_type][]" class="cr_width_full">';
1529
+
foreach ( get_post_types( '', 'names' ) as $post_type ) {
1530
+
if(strstr($post_type, 'aiomatic_'))
1531
+
{
1532
+
continue;
1533
+
}
1534
+
$output .= '<option value="' . esc_attr($post_type) . '"';
1535
+
if ($def_type == $post_type) {
1536
+
$output .= ' selected';
1537
+
}
1538
+
$output .= '>' . esc_html($post_type) . '</option>';
1539
+
}
1540
+
$output .= '</select>
1541
+
</div>
1542
+
</td></tr><tr><td>
1543
+
<div>
1544
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1545
+
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__('If your template supports "Post Formats", than you can select one here. If not, leave this at it\'s default value.', 'aiomatic-automatic-ai-content-writer') . '
1546
+
</div>
1547
+
</div>
1548
+
<b>' . esc_html__("Generated Post Format", 'aiomatic-automatic-ai-content-writer') . ':</b>
1549
+
</td><td>
1550
+
<select autocomplete="off" id="post_format' . esc_html($cont) . '" name="aiomatic_csv_list[post_format][]" class="cr_width_full">
1551
+
<option value="post-format-standard"';
1552
+
if ($post_format == 'post-format-standard') {
1553
+
$output .= ' selected';
1554
+
}
1555
+
$output .= '>' . esc_html__("Standard", 'aiomatic-automatic-ai-content-writer') . '</option>
1556
+
<option value="post-format-aside"';
1557
+
if ($post_format == 'post-format-aside') {
1558
+
$output .= ' selected';
1559
+
}
1560
+
$output .= '>' . esc_html__("Aside", 'aiomatic-automatic-ai-content-writer') . '</option>
1561
+
<option value="post-format-gallery"';
1562
+
if ($post_format == 'post-format-gallery') {
1563
+
$output .= ' selected';
1564
+
}
1565
+
$output .= '>' . esc_html__("Gallery", 'aiomatic-automatic-ai-content-writer') . '</option>
1566
+
<option value="post-format-link"';
1567
+
if ($post_format == 'post-format-link') {
1568
+
$output .= ' selected';
1569
+
}
1570
+
$output .= '>' . esc_html__("Link", 'aiomatic-automatic-ai-content-writer') . '</option>
1571
+
<option value="post-format-image"';
1572
+
if ($post_format == 'post-format-image') {
1573
+
$output .= ' selected';
1574
+
}
1575
+
$output .= '>' . esc_html__("Image", 'aiomatic-automatic-ai-content-writer') . '</option>
1576
+
<option value="post-format-quote"';
1577
+
if ($post_format == 'post-format-quote') {
1578
+
$output .= ' selected';
1579
+
}
1580
+
$output .= '>' . esc_html__("Quote", 'aiomatic-automatic-ai-content-writer') . '</option>
1581
+
<option value="post-format-status"';
1582
+
if ($post_format == 'post-format-status') {
1583
+
$output .= ' selected';
1584
+
}
1585
+
$output .= '>' . esc_html__("Status", 'aiomatic-automatic-ai-content-writer') . '</option>
1586
+
<option value="post-format-video"';
1587
+
if ($post_format == 'post-format-video') {
1588
+
$output .= ' selected';
1589
+
}
1590
+
$output .= '>' . esc_html__("Video", 'aiomatic-automatic-ai-content-writer') . '</option>
1591
+
<option value="post-format-audio"';
1592
+
if ($post_format == 'post-format-audio') {
1593
+
$output .= ' selected';
1594
+
}
1595
+
$output .= '>' . esc_html__("Audio", 'aiomatic-automatic-ai-content-writer') . '</option>
1596
+
<option value="post-format-chat"';
1597
+
if ($post_format == 'post-format-chat') {
1598
+
$output .= ' selected';
1599
+
}
1600
+
$output .= '>' . esc_html__("Chat", 'aiomatic-automatic-ai-content-writer') . '</option>
1601
+
</select>
1602
+
</div>
1603
+
</td></tr><tr><td>
1604
+
<div>
1605
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1606
+
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Set the ID of the parent of created posts. This is useful for BBPress integration, to assign forum IDs for created topics or for other similar functionalities.", 'aiomatic-automatic-ai-content-writer') . '
1607
+
</div>
1608
+
</div>
1609
+
<b>' . esc_html__("Post Parent ID", 'aiomatic-automatic-ai-content-writer') . ':</b>
1610
+
1611
+
</td><td>
1612
+
<input type="text" class="cr_width_full" name="aiomatic_csv_list[parent_id][]" value="' . esc_attr($parent_id) . '" placeholder="Post parent ID" class="cr_width_full">
1613
+
1614
+
</div>
1615
+
</td></tr><tr><td>
1616
+
<div>
1617
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1618
+
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("This feature will try to remove the WordPress\'s default post category. This may fail in case no additional categories are added, because WordPress requires at least one post category for every post.", 'aiomatic-automatic-ai-content-writer') . '
1619
+
</div>
1620
+
</div>
1621
+
<b>' . esc_html__("Remove WP Default Post Category", 'aiomatic-automatic-ai-content-writer') . ':</b>
1622
+
1623
+
</td><td>
1624
+
<input type="checkbox" id="remove_default' . esc_html($cont) . '" name="aiomatic_csv_list[remove_default][]"';
1625
+
if($remove_default == '1')
1626
+
{
1627
+
$output .= ' checked';
1628
+
}
1629
+
$output .= '>
1630
+
1631
+
</div>
1632
+
</td></tr><tr><td>
1633
+
<div>
1634
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1635
+
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Do you want to enable comments for the generated posts?", 'aiomatic-automatic-ai-content-writer') . '
1636
+
</div>
1637
+
</div>
1638
+
<b>' . esc_html__("Enable Comments For Posts", 'aiomatic-automatic-ai-content-writer') . ':</b>
1639
+
1640
+
</td><td>
1641
+
<input type="checkbox" id="enable_comments' . esc_html($cont) . '" name="aiomatic_csv_list[enable_comments][]"';
1642
+
if ($enable_comments == '1') {
1643
+
$output .= ' checked';
1644
+
}
1645
+
$output .= '>
1646
+
1647
+
</div>
1648
+
</td></tr><tr><td>
1649
+
<div>
1650
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1651
+
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Do you want to enable pingbacks and trackbacks for the generated posts?", 'aiomatic-automatic-ai-content-writer') . '
1652
+
</div>
1653
+
</div>
1654
+
<b>' . esc_html__("Enable Pingback/Trackback", 'aiomatic-automatic-ai-content-writer') . ':</b>
1655
+
1656
+
</td><td>
1657
+
<input type="checkbox" id="enable_pingback' . esc_html($cont) . '" name="aiomatic_csv_list[enable_pingback][]"';
1658
+
if ($enable_pingback == '1') {
1659
+
$output .= ' checked';
1660
+
}
1661
+
$output .= '>
1662
+
1663
+
</div>
1664
+
</td></tr><tr><td>
1665
+
<div>
1666
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1667
+
<div class="bws_hidden_help_text cr_min_260px">' . sprintf( wp_kses( __( "Do you want to set a custom post publish date for posts? Set the range in the below field Accepted values for this field are listed: <a href='%s' target='_blank'>here</a>. To disable this feature, leave this field blank.", 'aiomatic-automatic-ai-content-writer'), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url_raw( 'https://www.php.net/manual/en/datetime.formats.php' ) ) . '
1668
+
</div>
1669
+
</div>
1670
+
<b>' . esc_html__("Set a Custom Post Publish Date Range", 'aiomatic-automatic-ai-content-writer') . ':</b>
1671
+
1672
+
</td><td>
1673
+
<input type="text" id="min_time' . esc_html($cont) . '" name="aiomatic_csv_list[min_time][]" value="' . esc_attr($min_time) . '" placeholder="Start time" class="cr_half"> - <input type="text" id="max_time' . esc_html($cont) . '" name="aiomatic_csv_list[max_time][]" value="' . esc_attr($max_time) . '" placeholder="End time" class="cr_half">
1674
+
</div>
1675
+
</td></tr><tr><td class="cr_min_width_200">
1676
+
<div>
1677
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1678
+
<div class="bws_hidden_help_text_top cr_min_260px">' . esc_html__("Set the custom fields that will be set for generated posts. The syntax for this field is the following: custom_field_name1 => custom_field_value1, custom_field_name2 => custom_field_value2, ... . You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators. You can also use the following topic based shortcodes: %%post_title%%, %%random_sentence%%, %%post_original_title%%, %%random_sentence2%%, %%blog_title%%", 'aiomatic-automatic-ai-content-writer') . '
1679
+
</div>
1680
+
</div>
1681
+
<b>' . esc_html__("Post Custom Fields", 'aiomatic-automatic-ai-content-writer') . ':</b> <b><a href="https://coderevolution.ro/knowledge-base/faq/post-template-reference-advanced-usage/" target="_blank">ⓘ</a></b>
1682
+
1683
+
</td><td>
1684
+
<textarea rows="1" cols="70" name="aiomatic_csv_list[custom_fields][]" placeholder="Please insert your desired custom fields. Example: title_custom_field => %%post_title%%" class="cr_width_full">' . esc_textarea($custom_fields) . '</textarea>
1685
+
1686
+
</div>
1687
+
</td></tr><tr><td class="cr_min_width_200">
1688
+
<div>
1689
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1690
+
<div class="bws_hidden_help_text_top cr_min_260px">' . esc_html__("Set the custom taxonomies that will be set for generated posts. The syntax for this field is the following: custom_taxonomy_name1 => custom_taxonomy_value1A, custom_taxonomy_value1B; custom_taxonomy_name2 => custom_taxonomy_value2A, custom_taxonomy_value2B; ... . You can also set hierarhical taxonomies (parent > child), in this format: custom_taxonomy_name => parent1 > child1 . You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators. You can also use the following topic based shortcodes: %%post_title%%, %%random_sentence%%, %%post_original_title%%, %%random_sentence2%%, %%blog_title%%", 'aiomatic-automatic-ai-content-writer') . '
1691
+
</div>
1692
+
</div>
1693
+
<b>' . esc_html__("Post Custom Taxonomies", 'aiomatic-automatic-ai-content-writer') . ':</b> <b><a href="https://coderevolution.ro/knowledge-base/faq/post-template-reference-advanced-usage/" target="_blank">ⓘ</a></b>
1694
+
</td><td>
1695
+
<textarea rows="1" cols="70" name="aiomatic_csv_list[custom_tax][]" placeholder="Please insert your desired custom taxonomies. Example: custom_taxonomy_name => %%post_title%%" class="cr_width_full">' . esc_textarea($custom_tax) . '</textarea>
1696
+
</div>
1697
+
</td></tr><tr><td>
1698
+
<div>
1699
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1700
+
<div class="bws_hidden_help_text_top cr_min_260px">' . esc_html__("Enter a 2 letter language code that will be assigned as the WPML/Polylang language for posts. Example: for German, input: de", 'aiomatic-automatic-ai-content-writer') . '
1701
+
</div>
1702
+
</div>
1703
+
<b>' . esc_html__("Assign WPML/Polylang Language to Posts", 'aiomatic-automatic-ai-content-writer') . ':</b>
1704
+
1705
+
</td><td>
1706
+
<input type="text" class="cr_width_full" name="aiomatic_csv_list[wpml_lang][]" value="' . esc_attr($wpml_lang) . '" placeholder="WPML/Polylang language" class="cr_width_full">
1707
+
1708
+
</div>
1709
+
</td></tr><tr><td colspan="2"><h3>' . esc_html__('Automatic Linking Options', 'aiomatic-automatic-ai-content-writer') . ':</h3></td></tr><tr><td>
1710
+
<div>
1711
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1712
+
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Select the linking method to use in posts.", 'aiomatic-automatic-ai-content-writer') . '
1713
+
</div>
1714
+
</div>
1715
+
<b>' . esc_html__("Automatic Linking Type", 'aiomatic-automatic-ai-content-writer') . ':</b>
1716
+
1717
+
</td><td>
1718
+
<select autocomplete="off" class="cr_width_full" id="link_type' . esc_html($cont) . '" onchange="hideLinks(' . esc_html($cont) . ');" name="aiomatic_csv_list[link_type][]">
1719
+
<option value="disabled"';
1720
+
if ($link_type == 'disabled') {
1721
+
$output .= ' selected';
1722
+
}
1723
+
$output .= '>' . esc_html__("Disabled", 'aiomatic-automatic-ai-content-writer') . '</option>
1724
+
<option value="internal"';
1725
+
if ($link_type == 'internal') {
1726
+
$output .= ' selected';
1727
+
}
1728
+
$output .= '>' . esc_html__("Internal Links", 'aiomatic-automatic-ai-content-writer') . '</option>
1729
+
<option value="manual"';
1730
+
if ($link_type == 'manual') {
1731
+
$output .= ' selected';
1732
+
}
1733
+
$output .= '>' . esc_html__("Manual Links", 'aiomatic-automatic-ai-content-writer') . '</option>
1734
+
<option value="serp"';
1735
+
if ($link_type == 'serp') {
1736
+
$output .= ' selected';
1737
+
}
1738
+
$output .= '>' . esc_html__("Related SERP Links", 'aiomatic-automatic-ai-content-writer') . '</option>
1739
+
<option value="mixed"';
1740
+
if ($link_type == 'mixed') {
1741
+
$output .= ' selected';
1742
+
}
1743
+
$output .= '>' . esc_html__("Internal + Manual Links", 'aiomatic-automatic-ai-content-writer') . '</option>
1744
+
<option value="intserp"';
1745
+
if ($link_type == 'intserp') {
1746
+
$output .= ' selected';
1747
+
}
1748
+
$output .= '>' . esc_html__("Internal & SERP Links", 'aiomatic-automatic-ai-content-writer') . '</option>
1749
+
<option value="manserp"';
1750
+
if ($link_type == 'manserp') {
1751
+
$output .= ' selected';
1752
+
}
1753
+
$output .= '>' . esc_html__("Manual & SERP Links", 'aiomatic-automatic-ai-content-writer') . '</option>
1754
+
<option value="intmanserp"';
1755
+
if ($link_type == 'intmanserp') {
1756
+
$output .= ' selected';
1757
+
}
1758
+
$output .= '>' . esc_html__("Internal & Manual & SERP Links", 'aiomatic-automatic-ai-content-writer') . '</option>
1759
+
</select>
1760
+
</div>
1761
+
</td></tr>
1762
+
<tr><td class="cr_min_width_200">
1763
+
<div>
1764
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1765
+
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Set the maximum number of automatic links to add to created posts. You can also define custom ranges, like: 3-5. Please note that this feature will work best if you already have a considerable number of posts published on your site, which will be used for internal linking.", 'aiomatic-automatic-ai-content-writer') . '
1766
+
</div>
1767
+
</div>
1768
+
<b>' . esc_html__("Maximum Number Of Automatic Links To Add To The Post Content", 'aiomatic-automatic-ai-content-writer') . ':</b>
1769
+
</td><td>
1770
+
<input type="text" name="aiomatic_csv_list[max_links][]" placeholder="Add the number of links to enable this feature" class="cr_width_full" value="' . esc_attr($max_links) . '">
1771
+
</div>
1772
+
</td></tr>
1773
+
<tr class="hidelinks' . esc_html($cont) . '"><td class="cr_min_width_200">
1774
+
<div>
1775
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1776
+
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Enter a manual list of links, where the plugin will create links.", 'aiomatic-automatic-ai-content-writer') . '
1777
+
</div>
1778
+
</div>
1779
+
<b>' . esc_html__("Manual List Of URLs (One Per Line)", 'aiomatic-automatic-ai-content-writer') . ':</b>
1780
+
</td><td>
1781
+
<textarea rows="1" cols="70" name="aiomatic_csv_list[link_list][]" placeholder="URL list (one per line)" class="cr_width_full">' . esc_textarea($link_list) . '</textarea>
1782
+
1783
+
</div>
1784
+
</td></tr>
1785
+
<tr class="hidelinks' . esc_html($cont) . '"><td class="cr_min_width_200">
1786
+
<div>
1787
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1788
+
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Do you want to add nofollow attribute to manually entered, external links?", 'aiomatic-automatic-ai-content-writer') . '
1789
+
</div>
1790
+
</div>
1791
+
<b>' . esc_html__("Add Nofollow Attribute To External Links", 'aiomatic-automatic-ai-content-writer') . ':</b>
1792
+
</td><td>
1793
+
<input type="checkbox" name="aiomatic_csv_list[link_nofollow][]"';
1794
+
if($link_nofollow == '1')
1795
+
{
1796
+
$output .= ' checked';
1797
+
}
1798
+
$output .= '>
1799
+
1800
+
</div>
1801
+
</td></tr>
1802
+
<tr><td class="cr_min_width_200">
1803
+
<div>
1804
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1805
+
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Set the post types where to create automatic links in posts. You can also add a comma separated list of multiple post types.", 'aiomatic-automatic-ai-content-writer') . '
1806
+
</div>
1807
+
</div>
1808
+
<b>' . esc_html__("Post Types Where To Generate Automatic Links", 'aiomatic-automatic-ai-content-writer') . ':</b>
1809
+
</td><td>
1810
+
<input type="text" name="aiomatic_csv_list[link_post_types][]" placeholder="post" class="cr_width_full" value="' . esc_attr($link_post_types) . '">
1811
+
</div>
1812
+
</td></tr>
1813
+
<tr><td colspan="2"><h3>' . esc_html__('Scheduling Restrictions', 'aiomatic-automatic-ai-content-writer') . ':</h3></td></tr><tr><td class="cr_min_width_200">
1814
+
<div>
1815
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1816
+
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Select the days of the week when you don't want to run this rule. You can enter a comma separate list of day names.", 'aiomatic-automatic-ai-content-writer') . '
1817
+
</div>
1818
+
</div>
1819
+
<b>' . esc_html__("Do Not Run This Rule On The Following Days Of The Week", 'aiomatic-automatic-ai-content-writer') . ':</b>
1820
+
<br/>' . esc_html__("Current Server Time:", 'aiomatic-automatic-ai-content-writer') . ' ' . date('l', time()) . ', ' . date("Y-m-d H:i:s") . '
1821
+
</td><td>
1822
+
<input type="text" class="cr_width_full" name="aiomatic_csv_list[days_no_run][]" value="' . esc_attr($days_no_run) . '" placeholder="Mo,Tu,We,Th,Fr,Sa,Su" class="cr_width_full">
1823
+
</div>
1824
+
</td></tr>
1825
+
</table></div>
1826
+
</div>
1827
+
<div class="codemodalfzr-footer">
1828
+
<br/>
1829
+
<h3 class="cr_inline">Aimogen Automatic Post Generator</h3><span id="aiomatic_ok' . esc_html($cont) . '" class="codeokfzr cr_inline">OK </span>
1830
+
<br/><br/>
1831
+
</div>
1832
+
</div>
1833
+
1834
+
</div>
1835
+
</td>
1836
+
<td class="cr_shrt_td2"><span class="wpaiomatic-delete">X</span></td>
1837
+
<td class="cr_short_td"><input type="checkbox" name="aiomatic_csv_list[active][]" class="activateDeactivateClass" value="1"';
1838
+
if (isset($active) && $active === '1') {
1839
+
$output .= ' checked';
1840
+
}
1841
+
$output .= '/>
1842
+
<input type="hidden" name="aiomatic_csv_list[last_run][]" value="' . esc_attr($last_run) . '"/>
1843
+
<input type="hidden" name="aiomatic_csv_list[rule_unique_id][]" value="' . esc_attr($rule_unique_id) . '"/></td>
1844
+
<td class="cr_shrt_td2"><div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1845
+
<div class="bws_hidden_help_text cr_min_260px">' . sprintf( wp_kses( __( 'Shortcode for this rule<br/>(to cross-post from this plugin in other plugins):', 'aiomatic-automatic-ai-content-writer'), array( 'br' => array( ) ) ) ) . '<br/><b>%%aiomatic_4_' . esc_html($cont) . '%% and %%aiomatic_title_4_' . esc_html($cont) . '%%</b><br/>' . esc_html__('Posts Generated:', 'aiomatic-automatic-ai-content-writer') . ' ' . esc_html($generated_posts) . '<br/>';
1846
+
if ($generated_posts != 0) {
1847
+
$output .= '<a href="' . get_admin_url() . 'edit.php?coderevolution_post_source=Aiomatic_4_' . esc_html($cont) . '&post_type=' . esc_html($def_type) . '" target="_blank">' . esc_html__('View Generated Posts', 'aiomatic-automatic-ai-content-writer') . '</a><br/>';
1848
+
}
1849
+
$output .= esc_html__('Last Run: ', 'aiomatic-automatic-ai-content-writer');
1850
+
if ($last_run == '1988-01-27 00:00:00') {
1851
+
$output .= 'Never';
1852
+
} else {
1853
+
$output .= $last_run;
1854
+
}
1855
+
$output .= '<br/>' . esc_html__('Next Run: ', 'aiomatic-automatic-ai-content-writer');
1856
+
if($unlocker == '1')
1857
+
{
1858
+
$nextrun = aiomatic_add_minute($last_run, $schedule);
1859
+
}
1860
+
else
1861
+
{
1862
+
$nextrun = aiomatic_add_hour($last_run, $schedule);
1863
+
}
1864
+
$now = aiomatic_get_date_now();
1865
+
if (isset($active) && $active === '1') {
1866
+
if($unlocker == '1')
1867
+
{
1868
+
$aiomatic_hour_diff = (int)aiomatic_minute_diff($now, $nextrun);
1869
+
}
1870
+
else
1871
+
{
1872
+
$aiomatic_hour_diff = (int)aiomatic_hour_diff($now, $nextrun);
1873
+
}
1874
+
if ($aiomatic_hour_diff >= 0) {
1875
+
if($unlocker == '1')
1876
+
{
1877
+
$append = 'Now.';
1878
+
}
1879
+
else
1880
+
{
1881
+
$append = 'Now.';
1882
+
}
1883
+
$cron = _get_cron_array();
1884
+
if ($cron != FALSE) {
1885
+
$date_format = _x('Y-m-d H:i:s', 'Date Time Format1', 'aiomatic-automatic-ai-content-writer');
1886
+
foreach ($cron as $timestamp => $cronhooks) {
1887
+
foreach ((array) $cronhooks as $hook => $events) {
1888
+
if ($hook == 'aiomaticaction') {
1889
+
foreach ((array) $events as $key => $event) {
1890
+
$append = date_i18n($date_format, $timestamp);
1891
+
}
1892
+
}
1893
+
}
1894
+
}
1895
+
}
1896
+
$output .= $append;
1897
+
} else {
1898
+
$output .= $nextrun;
1899
+
}
1900
+
} else {
1901
+
$output .= esc_html__('Rule Disabled', 'aiomatic-automatic-ai-content-writer');
1902
+
}
1903
+
$output .= '<br/>' . esc_html__('Local Time: ', 'aiomatic-automatic-ai-content-writer') . $now;
1904
+
if(isset($aiomatic_Main_Settings['rule_webhook']) && $aiomatic_Main_Settings['rule_webhook'] == 'on')
1905
+
{
1906
+
$attsx = array();
1907
+
$attsx['secret'] = aiomatic_generate_site_secret();
1908
+
$attsx['ruleid'] = $cont;
1909
+
$attsx['ruletype'] = '4';
1910
+
$queryParams = http_build_query($attsx);
1911
+
$webhookUrl = esc_url(get_site_url() . '/wp-json/aiomatic/v1/rules?' . $queryParams);
1912
+
$webhookUrl = '<a href="' . $webhookUrl . '" target="_blank">' . $webhookUrl . '</a>';
1913
+
$output .= '<br/>' . esc_html__('Webhook To Run Rule: ', 'aiomatic-automatic-ai-content-writer') . '<br/>' . $webhookUrl;
1914
+
}
1915
+
$output .= '</div>
1916
+
</div></td>
1917
+
<td class="cr_center">
1918
+
<div>
1919
+
<img id="run_img' . esc_html($cont) . '" src="' . plugin_dir_url(dirname(__FILE__)) . 'images/running.gif' . '" alt="Running" class="cr_status_icon';
1920
+
if (!empty($running)) {
1921
+
if (!in_array(array($cont => 4), $running)) {
1922
+
$f = fopen(get_temp_dir() . 'aiomatic_4_' . $cont, 'w');
1923
+
if($f !== false)
1924
+
{
1925
+
flock($f, LOCK_UN);
1926
+
fclose($f);
1927
+
global $wp_filesystem;
1928
+
if ( ! is_a( $wp_filesystem, 'WP_Filesystem_Base') ){
1929
+
include_once(ABSPATH . 'wp-admin/includes/file.php');$creds = request_filesystem_credentials( site_url() );
1930
+
wp_filesystem($creds);
1931
+
}
1932
+
$wp_filesystem->delete(get_temp_dir() . 'aiomatic_4_' . $cont);
1933
+
}
1934
+
$output .= ' cr_hidden';
1935
+
}
1936
+
else
1937
+
{
1938
+
$f = fopen(get_temp_dir() . 'aiomatic_4_' . $cont, 'w');
1939
+
if($f !== false)
1940
+
{
1941
+
if (!flock($f, LOCK_EX | LOCK_NB)) {
1942
+
}
1943
+
else
1944
+
{
1945
+
$output .= ' cr_hidden';
1946
+
flock($f, LOCK_UN);
1947
+
if (($xxkey = array_search(array($cont => 4), $running)) !== false) {
1948
+
unset($running[$xxkey]);
1949
+
aiomatic_update_option('aiomatic_running_list', $running);
1950
+
}
1951
+
}
1952
+
}
1953
+
}
1954
+
}
1955
+
else
1956
+
{
1957
+
$f = fopen(get_temp_dir() . 'aiomatic_4_' . $cont, 'w');
1958
+
if($f !== false)
1959
+
{
1960
+
flock($f, LOCK_UN);
1961
+
fclose($f);
1962
+
global $wp_filesystem;
1963
+
if ( ! is_a( $wp_filesystem, 'WP_Filesystem_Base') ){
1964
+
include_once(ABSPATH . 'wp-admin/includes/file.php');$creds = request_filesystem_credentials( site_url() );
1965
+
wp_filesystem($creds);
1966
+
}
1967
+
$wp_filesystem->delete(get_temp_dir() . 'aiomatic_4_' . $cont);
1968
+
}
1969
+
$output .= ' cr_hidden';
1970
+
}
1971
+
$output .= '" title="status">
1972
+
<div class="codemainfzr cr_width_80p">
1973
+
<select autocomplete="off" class="codemainfzr" id="actions' . esc_html($cont) . '" class="actions" name="actions" onchange="actionsChangedManual(' . esc_html($cont) . ', this.value, 4, \'' . esc_html($rule_unique_id) . '\');" onfocus="this.selectedIndex = 0;">
1974
+
<option value="select" disabled selected>' . esc_html__("Select an Action", 'aiomatic-automatic-ai-content-writer') . '</option>
1975
+
<option value="run">' . esc_html__("Run This Rule Now", 'aiomatic-automatic-ai-content-writer') . '</option>
1976
+
<option value="duplicate">' . esc_html__("Duplicate This Rule", 'aiomatic-automatic-ai-content-writer') . '</option>
1977
+
<option value="up">' . esc_html__("Move This Rule Up", 'aiomatic-automatic-ai-content-writer') . '</option>
1978
+
<option value="down">' . esc_html__("Move This Rule Down", 'aiomatic-automatic-ai-content-writer') . '</option>
1979
+
<option value="trash">' . esc_html__("Send All Posts To Trash", 'aiomatic-automatic-ai-content-writer') . '</option>
1980
+
<option value="delete">' . esc_html__("Permanently Delete All Posts", 'aiomatic-automatic-ai-content-writer') . '</option>
1981
+
</select>
1982
+
</div>
1983
+
</div>
1984
+
</td>
1985
+
</tr>
1986
+
';
1987
+
$cont = $cont + 1;
1988
+
}
1989
+
}
1990
+
return $output;
1991
+
}
1992
+
?>