File size: 11,747 Bytes
a47e1ac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<?php
   function ums_logs()

   {
       $theme = wp_get_theme();
       if ( 'Madara' != $theme->name && 'Madara' != $theme->parent_theme ) {
           echo '<h1>This plugin requires the "Madara" theme to be installed and active on this site before it can function! Please install it from here: <a href="https://mangabooth.com/product/wp-manga-theme-madara/" target="_blank">Madara - WordPress Theme for Manga</a></h1>';
           return;
       }
       if( ! class_exists('WP_MANGA_STORAGE') ) {
           echo '<h1>This plugin requires the "Madara Core" plugin to be installed and active on this site before it can function! Please install it from here: <a href="https://mangabooth.com/product/wp-manga-theme-madara/" target="_blank">Madara - WordPress Theme for Manga</a></h1>';
           return;
       }
       global $wp_filesystem;
       if ( ! is_a( $wp_filesystem, 'WP_Filesystem_Base') ){
           include_once(ABSPATH . 'wp-admin/includes/file.php');$creds = request_filesystem_credentials( site_url() );
           wp_filesystem($creds);
       }
       if(isset($_POST['ums_delete']))
       {
           if($wp_filesystem->exists(WP_CONTENT_DIR . '/ums_info.log'))
           {
               $wp_filesystem->delete(WP_CONTENT_DIR . '/ums_info.log');
           }
       }
       if(isset($_POST['ums_delete_rules']))
       {
           $running = array();
           update_option('ums_running_list', $running);
           $flock_disabled = explode(',', ini_get('disable_functions'));
           if(!in_array('flock', $flock_disabled))
           {
               foreach (glob(get_temp_dir() . 'ums_*') as $filename) 
               {
                  $f = fopen($filename, 'w');
                  if($f !== false)
                  {
                     flock($f, LOCK_UN);
                     fclose($f);
                  }
                  $wp_filesystem->delete($filename);
               }
           }
       }
       if(isset($_POST['ums_restore_defaults']))
       {
           ums_activation_callback(true);
       }
       if(isset($_POST['ums_delete_all']))
       {
           ums_delete_all_posts();
       }
   ?>
<div class="wp-header-end"></div>

<div class="wrap gs_popuptype_holder seo_pops">

<div>

   <div>

      <h3>

         <?php echo esc_html__("System Info:", 'ultimate-manga-scraper');?> 

         <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">

            <div class="bws_hidden_help_text cr_min_260px">

               <?php

                  echo esc_html__("Some general system information.", 'ultimate-manga-scraper');

                  ?>

            </div>

         </div>

      </h3>

      <hr/>

      <table class="cr_server_stat">

         <tr class="cdr-dw-tr">

            <td class="cdr-dw-td"><?php echo esc_html__("User Agent:", 'ultimate-manga-scraper');?></td>

            <td class="cdr-dw-td-value"><?php echo esc_html($_SERVER['HTTP_USER_AGENT']); ?></td>

         </tr>

         <tr class="cdr-dw-tr">

            <td class="cdr-dw-td"><?php echo esc_html__("Web Server:", 'ultimate-manga-scraper');?></td>

            <td class="cdr-dw-td-value"><?php echo esc_html($_SERVER['SERVER_SOFTWARE']); ?></td>

         </tr>

         <tr class="cdr-dw-tr">

            <td class="cdr-dw-td"><?php echo esc_html__("PHP Version:", 'ultimate-manga-scraper');?></td>

            <td class="cdr-dw-td-value"><?php echo esc_html(phpversion()); ?></td>

         </tr>

         <tr class="cdr-dw-tr">

            <td class="cdr-dw-td"><?php echo esc_html__("PHP Max POST Size:", 'ultimate-manga-scraper');?></td>

            <td class="cdr-dw-td-value"><?php echo esc_html(ini_get('post_max_size')); ?></td>

         </tr>

         <tr class="cdr-dw-tr">

            <td class="cdr-dw-td"><?php echo esc_html__("PHP Max Upload Size:", 'ultimate-manga-scraper');?></td>

            <td class="cdr-dw-td-value"><?php echo esc_html(ini_get('upload_max_filesize')); ?></td>

         </tr>

         <tr class="cdr-dw-tr">

            <td class="cdr-dw-td"><?php echo esc_html__("PHP Memory Limit:", 'ultimate-manga-scraper');?></td>

            <td class="cdr-dw-td-value"><?php echo esc_html(ini_get('memory_limit')); ?></td>

         </tr>

         <tr class="cdr-dw-tr">

            <td class="cdr-dw-td"><?php echo esc_html__("PHP DateTime Class:", 'ultimate-manga-scraper');?></td>

            <td class="cdr-dw-td-value"><?php echo (class_exists('DateTime') && class_exists('DateTimeZone')) ? '<span class="cdr-green">' . esc_html__('Available', 'ultimate-manga-scraper') . '</span>' : '<span class="cdr-red">' . esc_html__('Not available', 'ultimate-manga-scraper') . '</span> | <a href="http://php.net/manual/en/datetime.installation.php" target="_blank">more info&raquo;</a>'; ?> </td>

         </tr>

         <tr class="cdr-dw-tr">

            <td class="cdr-dw-td"><?php echo esc_html__("PHP Curl:", 'ultimate-manga-scraper');?></td>

            <td class="cdr-dw-td-value"><?php echo (function_exists('curl_version')) ? '<span class="cdr-green">' . esc_html__('Available', 'ultimate-manga-scraper') . '</span>' : '<span class="cdr-red">' . esc_html__('Not available', 'ultimate-manga-scraper') . '</span>'; ?> </td>

         </tr>

         <?php do_action('coderevolution_dashboard_widget_server') ?>

      </table>

   </div>

   <div>

      <br/>

      <hr class="cr_special_hr"/>

      <div>

         <h3>

            <?php echo esc_html__("Rules Currently Running:", 'ultimate-manga-scraper');?>

            <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">

               <div class="bws_hidden_help_text cr_min_260px">

                  <?php

                     echo esc_html__("These rules are currently running on your server.", 'ultimate-manga-scraper');

                     ?>

               </div>

            </div>

         </h3>

         <div>

            <?php

               if (!get_option('ums_running_list')) {
                   $running = array();
               } else {
                   $running = get_option('ums_running_list');
               }
               if (!empty($running)) {
                   echo '<ul>';
                   foreach($running as $key => $thread)
                   {
                       foreach($thread as $param => $type)
                       {
                           $ech = '';
                           if ($type == '0') {
                               $ech .= 'FanFox Scraping Rules';
                           } elseif ($type == '1') {
                               $ech .= 'WuxiaWorld Scraping Rules';
                           } elseif ($type == '2') {
                               $ech .= 'NovGo Scraping Rules';
                           } elseif ($type == '3') {
                               $ech .= 'NewNovel Scraping Rules';
                           }
                           else{
                               $ech .= esc_html__('Unknown rule type: ', 'ultimate-manga-scraper') . $type;
                           }
                           echo '<li><b>' . esc_html($ech) . '</b> - ID' . esc_html($param) . '</li>';
                       }
                   }
                   echo '</ul>';        
               }
               else
               {
                   echo esc_html__('No rules are running right now', 'ultimate-manga-scraper');
               }
               ?>
         </div>
         <hr/>
         <form method="post" onsubmit="return confirm('<?php echo esc_html__('Are you sure you want to clear the running list?', 'ultimate-manga-scraper');?>');">
            <input name="ums_delete_rules" type="submit" title="<?php echo esc_html__('Caution! This is for debugging purpose only!', 'ultimate-manga-scraper');?>" value="<?php echo esc_html__('Clear Running Rules List', 'ultimate-manga-scraper');?>">
         </form>
      </div>
      <div>
         <br/>
         <hr class="cr_special_hr"/>

         <div>

            <h3>

               <?php echo esc_html__('Restore Plugin Default Settings', 'ultimate-manga-scraper');?> 

               <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">

                  <div class="bws_hidden_help_text cr_min_260px">

                     <?php

                        echo esc_html__('Hit this button and the plugin settings will be restored to their default values. Warning! All settings will be lost!', 'ultimate-manga-scraper');

                        ?>

                  </div>

               </div>

            </h3>

            <hr/>

            <form method="post" onsubmit="return confirm('<?php echo esc_html__('Are you sure you want to restore the default plugin settings?', 'ultimate-manga-scraper');?>');"><input name="ums_restore_defaults" type="submit" value="<?php echo esc_html__('Restore Plugin Default Settings', 'ultimate-manga-scraper');?>"></form>

         </div>

         <br/>

         <hr class="cr_special_hr"/>

         <div>

            <h3>

               <?php echo esc_html__('Delete All Posts Generated by this Plugin:', 'ultimate-manga-scraper');?> 

               <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">

                  <div class="bws_hidden_help_text cr_min_260px">

                     <?php

                        echo esc_html__('Hit this button and all posts generated by this plugin will be deleted!', 'ultimate-manga-scraper');

                        ?>

                  </div>

               </div>

            </h3>

            <hr/>

            <form method="post" onsubmit="return confirm('<?php echo esc_html__('Are you sure you want to delete all generated posts? This can take a while, please wait until it finishes.', 'ultimate-manga-scraper');?>');"><input name="ums_delete_all" type="submit" value="<?php echo esc_html__('Delete All Generated Posts', 'ultimate-manga-scraper');?>"></form>

         </div>

         <br/>

         <hr class="cr_special_hr"/>

         <h3>

            <?php echo esc_html__('Activity Log:', 'ultimate-manga-scraper');?>

            <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">

               <div class="bws_hidden_help_text cr_min_260px">

                  <?php

                     echo esc_html__('This is the main log of your plugin. Here will be listed every single instance of the rules you run or are automatically run by schedule jobs (if you enable logging, in the plugin configuration).', 'ultimate-manga-scraper');

                     ?>

               </div>

            </div>

         </h3>

         <div>

            <?php

               if($wp_filesystem->exists(WP_CONTENT_DIR . '/ums_info.log'))

               {
                    $log = $wp_filesystem->get_contents(WP_CONTENT_DIR . '/ums_info.log');
                   $log = esc_html($log);$log = str_replace('&lt;br/&gt;', '<br/>', $log);echo $log;
               }
               else
               {
                   echo esc_html__('Log empty', 'ultimate-manga-scraper');
               }
               ?>
         </div>
      </div>
      <hr/>
      <form method="post" onsubmit="return confirm('<?php echo esc_html__('Are you sure you want to delete all logs?', 'ultimate-manga-scraper');?>');">
         <input name="ums_delete" type="submit" value="<?php echo esc_html__('Delete Logs', 'ultimate-manga-scraper');?>">
      </form>
   </div>
</div>
<?php
   }
   ?>