Changeset 1437051
- Timestamp:
- 06/15/2016 10:50:32 AM (10 years ago)
- Location:
- csv-2-post
- Files:
-
- 132 added
- 11 edited
-
tags/8.2.13 (added)
-
tags/8.2.13/arrays (added)
-
tags/8.2.13/arrays/countries_array.php (added)
-
tags/8.2.13/arrays/index.php (added)
-
tags/8.2.13/arrays/schedule_array.php (added)
-
tags/8.2.13/arrays/settings_array.php (added)
-
tags/8.2.13/arrays/tableschema_array.php (added)
-
tags/8.2.13/classes (added)
-
tags/8.2.13/classes/class-automation.php (added)
-
tags/8.2.13/classes/class-categories.php (added)
-
tags/8.2.13/classes/class-charts.php (added)
-
tags/8.2.13/classes/class-configuration.php (added)
-
tags/8.2.13/classes/class-csv2post.php (added)
-
tags/8.2.13/classes/class-data.php (added)
-
tags/8.2.13/classes/class-files.php (added)
-
tags/8.2.13/classes/class-forms.php (added)
-
tags/8.2.13/classes/class-help.php (added)
-
tags/8.2.13/classes/class-install.php (added)
-
tags/8.2.13/classes/class-phplibrary.php (added)
-
tags/8.2.13/classes/class-pluginmenu.php (added)
-
tags/8.2.13/classes/class-requests.php (added)
-
tags/8.2.13/classes/class-schedule.php (added)
-
tags/8.2.13/classes/class-ui.php (added)
-
tags/8.2.13/classes/class-updates.php (added)
-
tags/8.2.13/classes/class-view.php (added)
-
tags/8.2.13/classes/class-wpcore.php (added)
-
tags/8.2.13/classes/class-wpdb.php (added)
-
tags/8.2.13/classes/index.php (added)
-
tags/8.2.13/css (added)
-
tags/8.2.13/css/admin.css (added)
-
tags/8.2.13/css/index.php (added)
-
tags/8.2.13/css/notifications.css (added)
-
tags/8.2.13/csv-2-post.php (added)
-
tags/8.2.13/images (added)
-
tags/8.2.13/images/add_extra.png (added)
-
tags/8.2.13/images/add_large.png (added)
-
tags/8.2.13/images/bars200.jpg (added)
-
tags/8.2.13/images/chat-icon.png (added)
-
tags/8.2.13/images/error_extra.png (added)
-
tags/8.2.13/images/error_large.png (added)
-
tags/8.2.13/images/help-icon.png (added)
-
tags/8.2.13/images/index.php (added)
-
tags/8.2.13/images/info-icon.gif (added)
-
tags/8.2.13/images/info-icon.png (added)
-
tags/8.2.13/images/info_extra.png (added)
-
tags/8.2.13/images/info_large.png (added)
-
tags/8.2.13/images/menus (added)
-
tags/8.2.13/images/menus/overlay.png (added)
-
tags/8.2.13/images/papergrid.jpg (added)
-
tags/8.2.13/images/processing_extra.png (added)
-
tags/8.2.13/images/processing_large.png (added)
-
tags/8.2.13/images/question_extra.png (added)
-
tags/8.2.13/images/question_large.png (added)
-
tags/8.2.13/images/restricted_extra.png (added)
-
tags/8.2.13/images/restricted_large.png (added)
-
tags/8.2.13/images/scriptgraphics (added)
-
tags/8.2.13/images/scriptgraphics/ajaxindicator.gif (added)
-
tags/8.2.13/images/stop_extra.png (added)
-
tags/8.2.13/images/stop_large.png (added)
-
tags/8.2.13/images/success_extra.png (added)
-
tags/8.2.13/images/success_large.png (added)
-
tags/8.2.13/images/trash-icon.gif (added)
-
tags/8.2.13/images/trash-icon.png (added)
-
tags/8.2.13/images/validation_extra.png (added)
-
tags/8.2.13/images/validation_large.png (added)
-
tags/8.2.13/images/video-icon.gif (added)
-
tags/8.2.13/images/video-icon.png (added)
-
tags/8.2.13/images/warning_extra.png (added)
-
tags/8.2.13/images/warning_large.png (added)
-
tags/8.2.13/js (added)
-
tags/8.2.13/js/common.js (added)
-
tags/8.2.13/js/common.min.js (added)
-
tags/8.2.13/js/index.php (added)
-
tags/8.2.13/languages (added)
-
tags/8.2.13/languages/csv2post-en_US.mo (added)
-
tags/8.2.13/languages/csv2post-en_US.po (added)
-
tags/8.2.13/languages/en_US.mo (added)
-
tags/8.2.13/license.txt (added)
-
tags/8.2.13/posttypes (added)
-
tags/8.2.13/posttypes/index.php (added)
-
tags/8.2.13/posttypes/posts.php (added)
-
tags/8.2.13/readme.txt (added)
-
tags/8.2.13/samples (added)
-
tags/8.2.13/samples/imagegroups (added)
-
tags/8.2.13/samples/imagegroups/acer-predator-g3-605-gaming-pc-front.jpg (added)
-
tags/8.2.13/samples/imagegroups/cyberpower-empire-elite-gaming-pc-front.jpg (added)
-
tags/8.2.13/samples/imagegroups/cyberpower-revolution-xtreme-gaming-pc-side.jpg (added)
-
tags/8.2.13/samples/imagegroups/empire-1.jpg (added)
-
tags/8.2.13/samples/imagegroups/empire-2.jpg (added)
-
tags/8.2.13/samples/imagegroups/empire-3.jpg (added)
-
tags/8.2.13/samples/imagegroups/predator-1.jpg (added)
-
tags/8.2.13/samples/imagegroups/predator-2.jpg (added)
-
tags/8.2.13/samples/imagegroups/predator-3.jpg (added)
-
tags/8.2.13/samples/imagegroups/predator-4.jpg (added)
-
tags/8.2.13/samples/imagegroups/predator-5.jpg (added)
-
tags/8.2.13/samples/imagegroups/predator-6.jpg (added)
-
tags/8.2.13/samples/imagegroups/predator-8.jpg (added)
-
tags/8.2.13/samples/imagegroups/readme.txt (added)
-
tags/8.2.13/samples/imagegroups/revolution-2.jpg (added)
-
tags/8.2.13/samples/imagegroups/revolution-4.jpg (added)
-
tags/8.2.13/samples/imagegroups/revolution-5.jpg (added)
-
tags/8.2.13/samples/imagegroups/revolution-8.jpg (added)
-
tags/8.2.13/uninstall.php (added)
-
tags/8.2.13/views (added)
-
tags/8.2.13/views/advanceddata.php (added)
-
tags/8.2.13/views/advancedposttypes.php (added)
-
tags/8.2.13/views/advancedreplacevaluerules.php (added)
-
tags/8.2.13/views/advancedtaxonomies.php (added)
-
tags/8.2.13/views/categorycreation.php (added)
-
tags/8.2.13/views/customfields.php (added)
-
tags/8.2.13/views/dates.php (added)
-
tags/8.2.13/views/defaultglobalpostsettings.php (added)
-
tags/8.2.13/views/index.php (added)
-
tags/8.2.13/views/infoallprojectshistory.php (added)
-
tags/8.2.13/views/infochecklist.php (added)
-
tags/8.2.13/views/infocsvfiles.php (added)
-
tags/8.2.13/views/infodatahistory.php (added)
-
tags/8.2.13/views/infodirectorysources.php (added)
-
tags/8.2.13/views/infolastpost.php (added)
-
tags/8.2.13/views/infoprojectsdata.php (added)
-
tags/8.2.13/views/infoprojectstable.php (added)
-
tags/8.2.13/views/infosources.php (added)
-
tags/8.2.13/views/main.php (added)
-
tags/8.2.13/views/postcategories.php (added)
-
tags/8.2.13/views/postsettings.php (added)
-
tags/8.2.13/views/setupcsv.php (added)
-
tags/8.2.13/views/setupdesign.php (added)
-
tags/8.2.13/views/setupimport.php (added)
-
tags/8.2.13/views/setupposts.php (added)
-
tags/8.2.13/views/setupproject.php (added)
-
tags/8.2.13/views/setuprules.php (added)
-
trunk/arrays/tableschema_array.php (modified) (1 diff)
-
trunk/classes/class-configuration.php (modified) (2 diffs)
-
trunk/classes/class-csv2post.php (modified) (32 diffs)
-
trunk/classes/class-install.php (modified) (6 diffs)
-
trunk/classes/class-requests.php (modified) (62 diffs)
-
trunk/classes/class-schedule.php (modified) (5 diffs)
-
trunk/classes/class-ui.php (modified) (1 diff)
-
trunk/classes/class-view.php (modified) (2 diffs)
-
trunk/classes/class-wpdb.php (modified) (6 diffs)
-
trunk/csv-2-post.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/uninstall.php (added)
Legend:
- Unmodified
- Added
- Removed
-
csv-2-post/trunk/arrays/tableschema_array.php
r1252652 r1437051 51 51 $c2p_tables_array = array(); 52 52 ################################################################################## 53 # webtechglobal_log #54 ##################################################################################55 $c2p_tables_array['tables']['webtechglobal_log']['name'] = $wpdb->prefix . 'webtechglobal_log';56 $c2p_tables_array['tables']['webtechglobal_log']['required'] = false;// required for all installations or not (boolean)57 $c2p_tables_array['tables']['webtechglobal_log']['pluginversion'] = '7.0.0';58 $c2p_tables_array['tables']['webtechglobal_log']['usercreated'] = false;// if the table is created as a result of user actions rather than core installation put true59 $c2p_tables_array['tables']['webtechglobal_log']['version'] = '0.0.1';// used to force updates based on version alone rather than individual differences60 $c2p_tables_array['tables']['webtechglobal_log']['primarykey'] = 'row_id';61 $c2p_tables_array['tables']['webtechglobal_log']['uniquekey'] = 'row_id';62 // webtechglobal_log - row_id63 $c2p_tables_array['tables']['webtechglobal_log']['columns']['row_id']['type'] = 'bigint(20)';64 $c2p_tables_array['tables']['webtechglobal_log']['columns']['row_id']['null'] = 'NOT NULL';65 $c2p_tables_array['tables']['webtechglobal_log']['columns']['row_id']['key'] = '';66 $c2p_tables_array['tables']['webtechglobal_log']['columns']['row_id']['default'] = '';67 $c2p_tables_array['tables']['webtechglobal_log']['columns']['row_id']['extra'] = 'AUTO_INCREMENT';68 // webtechglobal_log - outcome69 $c2p_tables_array['tables']['webtechglobal_log']['columns']['outcome']['type'] = 'tinyint(1)';70 $c2p_tables_array['tables']['webtechglobal_log']['columns']['outcome']['null'] = 'NOT NULL';71 $c2p_tables_array['tables']['webtechglobal_log']['columns']['outcome']['key'] = '';72 $c2p_tables_array['tables']['webtechglobal_log']['columns']['outcome']['default'] = '1';73 $c2p_tables_array['tables']['webtechglobal_log']['columns']['outcome']['extra'] = '';74 // webtechglobal_log - timestamp75 $c2p_tables_array['tables']['webtechglobal_log']['columns']['timestamp']['type'] = 'timestamp';76 $c2p_tables_array['tables']['webtechglobal_log']['columns']['timestamp']['null'] = 'NOT NULL';77 $c2p_tables_array['tables']['webtechglobal_log']['columns']['timestamp']['key'] = '';78 $c2p_tables_array['tables']['webtechglobal_log']['columns']['timestamp']['default'] = 'CURRENT_TIMESTAMP';79 $c2p_tables_array['tables']['webtechglobal_log']['columns']['timestamp']['extra'] = '';80 // webtechglobal_log - line81 $c2p_tables_array['tables']['webtechglobal_log']['columns']['line']['type'] = 'int(11)';82 $c2p_tables_array['tables']['webtechglobal_log']['columns']['line']['null'] = '';83 $c2p_tables_array['tables']['webtechglobal_log']['columns']['line']['key'] = '';84 $c2p_tables_array['tables']['webtechglobal_log']['columns']['line']['default'] = 'NULL';85 $c2p_tables_array['tables']['webtechglobal_log']['columns']['line']['extra'] = '';86 // webtechglobal_log - file87 $c2p_tables_array['tables']['webtechglobal_log']['columns']['file']['type'] = 'varchar(250)';88 $c2p_tables_array['tables']['webtechglobal_log']['columns']['file']['null'] = '';89 $c2p_tables_array['tables']['webtechglobal_log']['columns']['file']['key'] = '';90 $c2p_tables_array['tables']['webtechglobal_log']['columns']['file']['default'] = 'NULL';91 $c2p_tables_array['tables']['webtechglobal_log']['columns']['file']['extra'] = '';92 // webtechglobal_log - function93 $c2p_tables_array['tables']['webtechglobal_log']['columns']['function']['type'] = 'varchar(250)';94 $c2p_tables_array['tables']['webtechglobal_log']['columns']['function']['null'] = '';95 $c2p_tables_array['tables']['webtechglobal_log']['columns']['function']['key'] = '';96 $c2p_tables_array['tables']['webtechglobal_log']['columns']['function']['default'] = 'NULL';97 $c2p_tables_array['tables']['webtechglobal_log']['columns']['function']['extra'] = '';98 // webtechglobal_log - sqlresult99 $c2p_tables_array['tables']['webtechglobal_log']['columns']['sqlresult']['type'] = 'blob';100 $c2p_tables_array['tables']['webtechglobal_log']['columns']['sqlresult']['null'] = '';101 $c2p_tables_array['tables']['webtechglobal_log']['columns']['sqlresult']['key'] = '';102 $c2p_tables_array['tables']['webtechglobal_log']['columns']['sqlresult']['default'] = 'NULL';103 $c2p_tables_array['tables']['webtechglobal_log']['columns']['sqlresult']['extra'] = '';104 // webtechglobal_log - sqlquery105 $c2p_tables_array['tables']['webtechglobal_log']['columns']['sqlquery']['type'] = 'varchar(45)';106 $c2p_tables_array['tables']['webtechglobal_log']['columns']['sqlquery']['null'] = '';107 $c2p_tables_array['tables']['webtechglobal_log']['columns']['sqlquery']['key'] = '';108 $c2p_tables_array['tables']['webtechglobal_log']['columns']['sqlquery']['default'] = 'NULL';109 $c2p_tables_array['tables']['webtechglobal_log']['columns']['sqlquery']['extra'] = '';110 // webtechglobal_log - sqlerror111 $c2p_tables_array['tables']['webtechglobal_log']['columns']['sqlerror']['type'] = 'mediumtext';112 $c2p_tables_array['tables']['webtechglobal_log']['columns']['sqlerror']['null'] = '';113 $c2p_tables_array['tables']['webtechglobal_log']['columns']['sqlerror']['key'] = '';114 $c2p_tables_array['tables']['webtechglobal_log']['columns']['sqlerror']['default'] = 'NULL';115 $c2p_tables_array['tables']['webtechglobal_log']['columns']['sqlerror']['extra'] = '';116 // webtechglobal_log - wordpresserror117 $c2p_tables_array['tables']['webtechglobal_log']['columns']['wordpresserror']['type'] = 'mediumtext';118 $c2p_tables_array['tables']['webtechglobal_log']['columns']['wordpresserror']['null'] = '';119 $c2p_tables_array['tables']['webtechglobal_log']['columns']['wordpresserror']['key'] = '';120 $c2p_tables_array['tables']['webtechglobal_log']['columns']['wordpresserror']['default'] = 'NULL';121 $c2p_tables_array['tables']['webtechglobal_log']['columns']['wordpresserror']['extra'] = '';122 // webtechglobal_log - screenshoturl123 $c2p_tables_array['tables']['webtechglobal_log']['columns']['screenshoturl']['type'] = 'varchar(500)';124 $c2p_tables_array['tables']['webtechglobal_log']['columns']['screenshoturl']['null'] = '';125 $c2p_tables_array['tables']['webtechglobal_log']['columns']['screenshoturl']['key'] = '';126 $c2p_tables_array['tables']['webtechglobal_log']['columns']['screenshoturl']['default'] = 'NULL';127 $c2p_tables_array['tables']['webtechglobal_log']['columns']['screenshoturl']['extra'] = '';128 // webtechglobal_log - userscomment129 $c2p_tables_array['tables']['webtechglobal_log']['columns']['userscomment']['type'] = 'mediumtext';130 $c2p_tables_array['tables']['webtechglobal_log']['columns']['userscomment']['null'] = '';131 $c2p_tables_array['tables']['webtechglobal_log']['columns']['userscomment']['key'] = '';132 $c2p_tables_array['tables']['webtechglobal_log']['columns']['userscomment']['default'] = 'NULL';133 $c2p_tables_array['tables']['webtechglobal_log']['columns']['userscomment']['extra'] = '';134 // webtechglobal_log - page135 $c2p_tables_array['tables']['webtechglobal_log']['columns']['page']['type'] = 'varchar(45)';136 $c2p_tables_array['tables']['webtechglobal_log']['columns']['page']['null'] = '';137 $c2p_tables_array['tables']['webtechglobal_log']['columns']['page']['key'] = '';138 $c2p_tables_array['tables']['webtechglobal_log']['columns']['page']['default'] = 'NULL';139 $c2p_tables_array['tables']['webtechglobal_log']['columns']['page']['extra'] = '';140 // webtechglobal_log - version141 $c2p_tables_array['tables']['webtechglobal_log']['columns']['version']['type'] = 'varchar(45)';142 $c2p_tables_array['tables']['webtechglobal_log']['columns']['version']['null'] = '';143 $c2p_tables_array['tables']['webtechglobal_log']['columns']['version']['key'] = '';144 $c2p_tables_array['tables']['webtechglobal_log']['columns']['version']['default'] = 'NULL';145 $c2p_tables_array['tables']['webtechglobal_log']['columns']['version']['extra'] = '';146 // webtechglobal_log - panelid147 $c2p_tables_array['tables']['webtechglobal_log']['columns']['panelid']['type'] = 'varchar(45)';148 $c2p_tables_array['tables']['webtechglobal_log']['columns']['panelid']['null'] = '';149 $c2p_tables_array['tables']['webtechglobal_log']['columns']['panelid']['key'] = '';150 $c2p_tables_array['tables']['webtechglobal_log']['columns']['panelid']['default'] = 'NULL';151 $c2p_tables_array['tables']['webtechglobal_log']['columns']['panelid']['extra'] = '';152 // webtechglobal_log - panelname153 $c2p_tables_array['tables']['webtechglobal_log']['columns']['panelname']['type'] = 'varchar(45)';154 $c2p_tables_array['tables']['webtechglobal_log']['columns']['panelname']['null'] = '';155 $c2p_tables_array['tables']['webtechglobal_log']['columns']['panelname']['key'] = '';156 $c2p_tables_array['tables']['webtechglobal_log']['columns']['panelname']['default'] = 'NULL';157 $c2p_tables_array['tables']['webtechglobal_log']['columns']['panelname']['extra'] = '';158 // webtechglobal_log - tabscreenid159 $c2p_tables_array['tables']['webtechglobal_log']['columns']['tabscreenid']['type'] = 'varchar(45)';160 $c2p_tables_array['tables']['webtechglobal_log']['columns']['tabscreenid']['null'] = '';161 $c2p_tables_array['tables']['webtechglobal_log']['columns']['tabscreenid']['key'] = '';162 $c2p_tables_array['tables']['webtechglobal_log']['columns']['tabscreenid']['default'] = 'NULL';163 $c2p_tables_array['tables']['webtechglobal_log']['columns']['tabscreenid']['extra'] = '';164 // webtechglobal_log - tabscreenname165 $c2p_tables_array['tables']['webtechglobal_log']['columns']['tabscreenname']['type'] = 'varchar(45)';166 $c2p_tables_array['tables']['webtechglobal_log']['columns']['tabscreenname']['null'] = '';167 $c2p_tables_array['tables']['webtechglobal_log']['columns']['tabscreenname']['key'] = '';168 $c2p_tables_array['tables']['webtechglobal_log']['columns']['tabscreenname']['default'] = 'NULL';169 $c2p_tables_array['tables']['webtechglobal_log']['columns']['tabscreenname']['extra'] = '';170 // webtechglobal_log - dump171 $c2p_tables_array['tables']['webtechglobal_log']['columns']['dump']['type'] = 'longblob';172 $c2p_tables_array['tables']['webtechglobal_log']['columns']['dump']['null'] = '';173 $c2p_tables_array['tables']['webtechglobal_log']['columns']['dump']['key'] = '';174 $c2p_tables_array['tables']['webtechglobal_log']['columns']['dump']['default'] = 'NULL';175 $c2p_tables_array['tables']['webtechglobal_log']['columns']['dump']['extra'] = '';176 // webtechglobal_log - ipaddress177 $c2p_tables_array['tables']['webtechglobal_log']['columns']['ipaddress']['type'] = 'varchar(45)';178 $c2p_tables_array['tables']['webtechglobal_log']['columns']['ipaddress']['null'] = '';179 $c2p_tables_array['tables']['webtechglobal_log']['columns']['ipaddress']['key'] = '';180 $c2p_tables_array['tables']['webtechglobal_log']['columns']['ipaddress']['default'] = 'NULL';181 $c2p_tables_array['tables']['webtechglobal_log']['columns']['ipaddress']['extra'] = '';182 // webtechglobal_log - userid183 $c2p_tables_array['tables']['webtechglobal_log']['columns']['userid']['type'] = 'int(11)';184 $c2p_tables_array['tables']['webtechglobal_log']['columns']['userid']['null'] = '';185 $c2p_tables_array['tables']['webtechglobal_log']['columns']['userid']['key'] = '';186 $c2p_tables_array['tables']['webtechglobal_log']['columns']['userid']['default'] = 'NULL';187 $c2p_tables_array['tables']['webtechglobal_log']['columns']['userid']['extra'] = '';188 // webtechglobal_log - comment189 $c2p_tables_array['tables']['webtechglobal_log']['columns']['comment']['type'] = 'mediumtext';190 $c2p_tables_array['tables']['webtechglobal_log']['columns']['comment']['null'] = '';191 $c2p_tables_array['tables']['webtechglobal_log']['columns']['comment']['key'] = '';192 $c2p_tables_array['tables']['webtechglobal_log']['columns']['comment']['default'] = 'NULL';193 $c2p_tables_array['tables']['webtechglobal_log']['columns']['comment']['extra'] = '';194 // webtechglobal_log - type195 $c2p_tables_array['tables']['webtechglobal_log']['columns']['type']['type'] = 'varchar(45)';196 $c2p_tables_array['tables']['webtechglobal_log']['columns']['type']['null'] = '';197 $c2p_tables_array['tables']['webtechglobal_log']['columns']['type']['key'] = '';198 $c2p_tables_array['tables']['webtechglobal_log']['columns']['type']['default'] = 'NULL';199 $c2p_tables_array['tables']['webtechglobal_log']['columns']['type']['extra'] = '';200 // webtechglobal_log - category201 $c2p_tables_array['tables']['webtechglobal_log']['columns']['category']['type'] = 'varchar(45)';202 $c2p_tables_array['tables']['webtechglobal_log']['columns']['category']['null'] = '';203 $c2p_tables_array['tables']['webtechglobal_log']['columns']['category']['key'] = '';204 $c2p_tables_array['tables']['webtechglobal_log']['columns']['category']['default'] = 'NULL';205 $c2p_tables_array['tables']['webtechglobal_log']['columns']['category']['extra'] = '';206 // webtechglobal_log - action207 $c2p_tables_array['tables']['webtechglobal_log']['columns']['action']['type'] = 'varchar(45)';208 $c2p_tables_array['tables']['webtechglobal_log']['columns']['action']['null'] = '';209 $c2p_tables_array['tables']['webtechglobal_log']['columns']['action']['key'] = '';210 $c2p_tables_array['tables']['webtechglobal_log']['columns']['action']['default'] = 'NULL';211 $c2p_tables_array['tables']['webtechglobal_log']['columns']['action']['extra'] = '';212 // webtechglobal_log - priority213 $c2p_tables_array['tables']['webtechglobal_log']['columns']['priority']['type'] = 'varchar(45)';214 $c2p_tables_array['tables']['webtechglobal_log']['columns']['priority']['null'] = '';215 $c2p_tables_array['tables']['webtechglobal_log']['columns']['priority']['key'] = '';216 $c2p_tables_array['tables']['webtechglobal_log']['columns']['priority']['default'] = 'NULL';217 $c2p_tables_array['tables']['webtechglobal_log']['columns']['priority']['extra'] = '';218 ##################################################################################219 53 # c2pprojects # 220 54 ################################################################################## -
csv-2-post/trunk/classes/class-configuration.php
r1355720 r1437051 12 12 defined( 'ABSPATH' ) || die( 'No direct script access allowed!' ); 13 13 14 class CSV2POST_Configuration extends CSV2POST_Log{14 class CSV2POST_Configuration { 15 15 16 16 // decrease or increase based on page name, only needs changed once … … 58 58 59 59 array( 'admin_enqueue_scripts', 'plugin_admin_enqueue_scripts', 'pluginscreens' ), 60 array( ' init','plugin_admin_register_styles', 'pluginscreens' ),61 array( 'admin_print_styles', 'plugin_admin_ print_styles', 'pluginscreens' ),60 array( 'admin_enqueue_scripts', 'plugin_admin_register_styles', 'pluginscreens' ), 61 array( 'admin_print_styles', 'plugin_admin_enqueue_styles', 'pluginscreens' ), 62 62 array( 'admin_notices', 'admin_notices', 'admin_notices' ), 63 63 array( 'upgrader_process_complete', 'complete_plugin_update', 'adminpages' ), -
csv-2-post/trunk/classes/class-csv2post.php
r1372216 r1437051 120 120 121 121 /** 122 * register admin only .css must be done before printing styles 122 * Register custom css on admin only. 123 * 124 * Must be done before enqueue styles and printing them. 123 125 * 124 126 * @author Ryan R. Bayne … … 140 142 * @version 1.1 141 143 */ 142 public function plugin_admin_ print_styles() {144 public function plugin_admin_enqueue_styles() { 143 145 wp_enqueue_style( 'csv2post_css_notification' ); 144 wp_enqueue_style( 'csv2post_css_admin' ); 146 wp_enqueue_style( 'csv2post_css_admin' ); 147 wp_enqueue_style( 'wp-pointer' ); 145 148 } 146 149 … … 154 157 */ 155 158 public function plugin_admin_enqueue_scripts() { 156 wp_enqueue_script( 'wp-pointer' ); 157 wp_enqueue_style( 'wp-pointer' ); 159 wp_enqueue_script( 'wp-pointer' ); 158 160 } 159 161 … … 469 471 case 'administrator': 470 472 471 require_once( ABSPATH . '/wp-load.php' );472 if( !function_exists('get_currentuserinfo')){473 require_once( ABSPATH . '/wp-load.php' ); 474 if( !function_exists( 'wp_get_current_user' ) ){ 473 475 require_once( ABSPATH . WPINC . '/formatting.php' ); 474 476 require_once( ABSPATH . WPINC . '/capabilities.php' ); … … 1042 1044 // do not continue if WordPress is DOING_AJAX 1043 1045 if( self::request_made() ){return;} 1044 1045 self::log_schedule( __( 'The schedule is being checked. There should be further log entries explaining the outcome.', 'csv2post' ), __( 'schedule being checked', 'csv2post' ),1, 'scheduledeventcheck', __LINE__, __FILE__, __FUNCTION__); 1046 1046 1047 1047 // now do checks that we will store the return reason for to allow us to quickly determine why it goes no further 1048 1048 // get and ensure we have the schedule array … … 1050 1050 // do not use csv2post_event_refused as we do not want to set the array 1051 1051 if(!isset( $csv2post_schedule_array ) || !is_array( $csv2post_schedule_array ) ){ 1052 self::log_schedule( __( 'Scheduled events cannot be peformed due to the schedule array of stored settings not existing.', 'csv2post' ), __( 'schedule settings missing', 'csv2post' ),1, 'scheduledeventcheck', __LINE__, __FILE__, __FUNCTION__);1053 1052 return false; 1054 1053 }// hack … … 1062 1061 1063 1062 if( $soonest > time() ){ 1064 self::log_schedule( __( 'No changed made as it has not been 60 seconds since the last event.', 'csv2post' ), __( 'enforcing schedule event delay', 'csv2post' ),1, 'scheduledeventcheck', __LINE__, __FILE__, __FUNCTION__);1065 1063 self::event_return( __( 'has not been 60 seconds since last event', 'csv2post' ) ); 1066 1064 return; … … 1073 1071 $csv2post_schedule_array['history']['lastreturnreason'] = __( 'The last even time event was set for the first time, no further processing was done.', 'csv2post' ); 1074 1072 self::update_option_schedule_array( $csv2post_schedule_array ); 1075 self::log_schedule( __( 'The plugin initialized the timer for enforcing a delay between events. This action is treated as an event itself and no further1076 changes are made during this schedule check.', 'csv2post' ), __( 'initialized schedule delay timer', 'csv2post' ),1, 'scheduledeventcheck', __LINE__, __FILE__, __FUNCTION__);1077 1078 1073 self::event_return( __( 'initialised the last event time value', 'csv2post' ) ); 1079 1074 return; … … 1086 1081 $csv2post_schedule_array['history']['lastreturnreason'] = __( 'The last event type value was set for the first time', 'csv2post' ); 1087 1082 self::update_option_schedule_array( $csv2post_schedule_array ); 1088 1089 self::log_schedule( __( 'The plugin initialized last event type value, this tells the plugin what event was last performed and it is used to1090 determine what event comes next.', 'csv2post' ), __( 'initialized schedule last event value', 'csv2post' ),1, 'scheduledeventcheck', __LINE__, __FILE__, __FUNCTION__);1091 1092 1083 self::event_return( __( 'initialised last event type value', 'csv2post' ) ); 1093 1084 return; … … 1100 1091 $csv2post_schedule_array['history']['lastreturnreason'] = __( 'The last daily reset time was set for the first time', 'csv2post' ); 1101 1092 self::update_option_schedule_array( $csv2post_schedule_array ); 1102 1103 self::log_schedule( __( 'Day timer was set in schedule system. This is the 24 hour timer used to track daily events. It was set, no further action was taking1104 and should only happen once.', 'csv2post' ), __( '24 hour timer set', 'csv2post' ),1, 'scheduledeventcheck', __LINE__, __FILE__, __FUNCTION__);1105 1106 1093 self::event_return( __( 'initialised last daily reset time', 'csv2post' ) ); 1107 1094 return; … … 1114 1101 $csv2post_schedule_array['history']['lastreturnreason'] = __( 'The hourly reset time was set for the first time', 'csv2post' ); 1115 1102 self::update_option_schedule_array( $csv2post_schedule_array ); 1116 1117 self::log_schedule( __( 'Hourly timer was set in schedule system. The time has been set for hourly countdown. No further action was1118 taking. This should only happen once.', 'csv2post' ), __( 'one hour timer set', 'csv2post' ),1, 'scheduledeventcheck', __LINE__, __FILE__, __FUNCTION__);1119 1120 1103 self::event_return( __( 'initialised hourly reset time', 'csv2post' ) ); 1121 1104 return; … … 1128 1111 $csv2post_schedule_array['history']['lastreturnreason'] = __( 'The hourly events counter was set for the first time', 'csv2post' ); 1129 1112 self::update_option_schedule_array( $csv2post_schedule_array ); 1130 self::log_schedule( __( 'Number of events per hour has been set for the first time, this change is treated as an event.', 'csv2post' ), __( 'hourly events counter set', 'csv2post' ),1, 'scheduledeventcheck', __LINE__, __FILE__, __FUNCTION__);1131 1113 self::event_return( __( 'initialised hourly events counter', 'csv2post' ) ); 1132 1114 return; … … 1139 1121 $csv2post_schedule_array['history']['lastreturnreason'] = __( 'The daily events counter was set for the first time', 'csv2post' ); 1140 1122 self::update_option_schedule_array( $csv2post_schedule_array ); 1141 self::log_schedule( __( 'The daily events counter was not set. No further action was taking. This measure should only happen once.', 'csv2post' ), __( 'daily events counter set', 'csv2post' ),1, 'scheduledeventcheck', __LINE__, __FILE__, __FUNCTION__);1142 1123 self::event_return( __( 'initialised daily events counter', 'csv2post' ) ); 1143 1124 return; … … 1154 1135 $csv2post_schedule_array['history']['lastreturnreason'] = __( 'Hourly counter was reset for another 60 minute period', 'csv2post' ); 1155 1136 self::update_option_schedule_array( $csv2post_schedule_array ); 1156 self::log_schedule( __( 'Hourly counter has been reset, no further action is taking during this event. This should only happen once every hour.', 'csv2post' ), __( 'hourly counter reset', 'csv2post' ),1, 'scheduledeventcheck', __LINE__, __FILE__, __FUNCTION__);1157 1137 self::event_return( __( 'hourly counter was reset', 'csv2post' ) ); 1158 1138 return; … … 1169 1149 $csv2post_schedule_array['history']['lastreturnreason'] = __( 'Daily and hourly events counter reset for a new 24 hours period', 'csv2post' ); 1170 1150 self::update_option_schedule_array( $csv2post_schedule_array ); 1171 self::log_schedule( __( '24 hours had passed and the daily counter had to be reset. No further action is taking during these events and this should only happen once a day.', 'csv2post' ), __( 'daily counter reset', 'csv2post' ),1, 'scheduledeventcheck', __LINE__, __FILE__, __FUNCTION__);1172 1151 self::event_return( '24 hour counter was reset' ); 1173 1152 return; … … 1179 1158 { 1180 1159 self::event_return( __( 'Event processing is has not been permitted for today', 'csv2post' ) ); 1181 self::log_schedule( __( 'Event processing is not permitted for today. Please check schedule settings to change this.', 'csv2post' ), __( 'schedule not permitted today', 'csv2post' ),1, 'scheduledeventcheck', __LINE__, __FILE__, __FUNCTION__);1182 1160 self::event_return( 'schedule not permitting day' ); 1183 1161 return; … … 1189 1167 { 1190 1168 self::event_return( __( 'Event processing is has not been permitted for the hour', 'csv2post' ) ); 1191 self::log_schedule( __( 'Processsing is not permitted for the current hour. Please check schedule settings to change this.', 'csv2post' ), __( 'hour not permitted', 'csv2post' ),1, 'scheduledeventcheck', __LINE__, __FILE__, __FUNCTION__);1192 1169 self::event_return( __( 'schedule not permitting hour', 'csv2post' ) ); 1193 1170 return; … … 1200 1177 $csv2post_schedule_array['history']['lastreturnreason'] = __( 'Hourly limit was set for the first time', 'csv2post' ); 1201 1178 self::update_option_schedule_array( $csv2post_schedule_array ); 1202 self::log_schedule( __( 'The hourly limit value had not been set yet. You can change the limit but the default has been set to one. No further action is taking during this event and this should only happen once.', 'csv2post' ), __( 'no hourly limit set', 'csv2post' ),1, 'scheduledeventcheck', __LINE__, __FILE__, __FUNCTION__);1203 1179 self::event_return( __( 'initialised hourly limit', 'csv2post' ) ); 1204 1180 return; … … 1211 1187 $csv2post_schedule_array['history']['lastreturnreason'] = __( 'Daily limit was set for the first time', 'csv2post' ); 1212 1188 self::update_option_schedule_array( $csv2post_schedule_array ); 1213 self::log_schedule( __( 'The daily limit value had not been set yet. It has now been set as one which allows only one post to be created or updated etc. This action should only happen once.', 'csv2post' ), __( 'no daily limit set', 'csv2post' ),1, 'scheduledeventcheck', __LINE__, __FILE__, __FUNCTION__);1214 1189 self::event_return( __( 'initialised daily limit', 'csv2post' ) ); 1215 1190 return; … … 1220 1195 { 1221 1196 self::event_return( 'The hours event limit/target has been met' ); 1222 self::log_schedule( __( 'The events target for the current hour has been met so no further processing is permitted.', 'csv2post' ), __( 'hourly target met', 'csv2post' ),1, 'scheduledeventcheck', __LINE__, __FILE__, __FUNCTION__);1223 1197 self::event_return( __( 'hours limit reached', 'csv2post' ) ); 1224 1198 return; … … 1229 1203 { 1230 1204 self::event_return( __( 'The days event limit/target has been met', 'csv2post' ) ); 1231 self::log_schedule( __( 'The daily events target has been met for the current 24 hour period (see daily timer counter). No events will be processed until the daily timer reaches 24 hours and is reset.', 'csv2post' ), __( 'daily target met', 'csv2post' ),1, 'scheduledeventcheck', __LINE__, __FILE__, __FUNCTION__);1232 1205 self::event_return( __( 'days limit reached', 'csv2post' ) ); 1233 1206 return; … … 1236 1209 // decide which event should be run (based on previous event, all events history and settings) 1237 1210 $run_event_type = $this->event_decide(); 1238 1239 self::log_schedule(sprintf( __( 'The schedule system decided that the next event type is %s.', 'csv2post' ), $run_event_type), __( 'next event type determined', 'csv2post' ),1, 'scheduledeventcheck', __LINE__, __FILE__, __FUNCTION__); 1240 1211 1241 1212 // update $csv2post_schedule_array with decided event type to advance the cycle and increase hourly plus daily counter 1242 1213 $csv2post_schedule_array['history']['lasteventtype'] = $run_event_type; … … 1270 1241 if( $override_event && is_string( $override_event) ) 1271 1242 { 1272 self::log_schedule(sprintf( __( 'The plugins ability to override the next due event type has been applied and then next event forced is %s.', 'csv2post' ), $override_event), __( 'next event type override', 'csv2post' ),1, 'scheduledeventcheck', __LINE__, __FILE__, __FUNCTION__);1273 1243 return $override_event; 1274 1244 } … … 1564 1534 require( CSV2POST_ABSPATH . 'posttypes/posts.php' ); 1565 1535 } 1566 1567 /**1568 * Admin Triggered Automation1569 */1570 public function admin_triggered_automation() {1571 // clear out log table (48 hour log)1572 self::log_cleanup();1573 }1574 1536 1575 1537 /** … … 1805 1767 // update post - start method is the beginning of many nested functions 1806 1768 $updatepost->start(); 1807 1808 // log1809 $atts = array(1810 'outcome' => 1,1811 'line' => __LINE__,1812 'function' => __FUNCTION__,1813 'file' => __FILE__,1814 'type' => 'general',1815 'category' => 'usertrace',1816 'action' => __( "Systematic post update applied to post ID " . $thepost->ID . " and belongs to project ID " . $project_id . '.', 'csv2post' ),1817 'priority' => 'normal',1818 'triga' => 'systematic'1819 );1820 1821 self::newlog( $atts );1822 1769 1823 1770 // if a single post we can refresh - not going to do this if form submitted … … 2112 2059 2113 2060 $result = wp_mail( $recipients, $subject, $content ); 2114 2115 // log2116 $atts = array(2117 'outcome' => 1,2118 'line' => __LINE__,2119 'function' => __FUNCTION__,2120 'file' => __FILE__,2121 'userid' => get_current_user_id(),2122 'type' => 'communication',2123 'category' => 'sendmail',2124 'action' => __( 'Send mail attempt.', 'csv2post' ),2125 'priority' => 'normal',2126 'triga' => 'unknown'2127 );2128 2129 self::newlog( $atts );2130 2061 2131 2062 if( $content_type == 'html' ) … … 2200 2131 // get admin settings again, all submissions and processing should update settings 2201 2132 // if the interface does not show expected changes, it means there is a problem updating settings before this line 2202 $csv2post_settings = self::adminsettings(); 2203 2204 get_currentuserinfo();?> 2133 $csv2post_settings = self::adminsettings(); ?> 2205 2134 2206 2135 <div id="csv2post-page" class="wrap"> … … 2226 2155 $this->UI->display_current_project(); 2227 2156 } 2228 2229 // run specific admin triggered automation tasks, this way an output can be created for admin to see2230 self::admin_triggered_automation();2231 2157 2232 2158 // check existing plugins and give advice or warnings … … 3071 2997 $autoblog->start(); 3072 2998 } 3073 3074 // log3075 $atts = array(3076 'outcome' => 1,3077 'line' => __LINE__,3078 'function' => __FUNCTION__,3079 'file' => __FILE__,3080 'userid' => get_current_user_id(),3081 'type' => 'general',3082 'category' => 'postsevent',3083 'action' => __( "Up to $foreach_done posts may have been created.", 'csv2post' ),3084 'priority' => 'normal',3085 'triga' => 'manualrequest'3086 );3087 3088 self::newlog( $atts );3089 2999 } 3090 3000 … … 3157 3067 // create a post - start method is the beginning of many nested functions 3158 3068 $autoblog->start(); 3159 } 3160 3161 // log 3162 $atts = array( 3163 'outcome' => 1, 3164 'line' => __LINE__, 3165 'function' => __FUNCTION__, 3166 'file' => __FILE__, 3167 'userid' => get_current_user_id(), 3168 'type' => 'general', 3169 'category' => 'postsevent', 3170 'action' => __( "Up to $foreach_done posts may have been updated.", 'csv2post' ), 3171 'priority' => 'normal', 3172 'triga' => 'manualrequest' 3173 ); 3174 3175 self::newlog( $atts ); 3069 } 3176 3070 } 3177 3071 … … 3318 3212 $result_array['error'] = false;// normal operation should lead to a green notice 3319 3213 $result_array['message'] = __( 'Your sources directory does not have a new file since CSV 2 POST last checked.', 'csv2post' ); 3320 3321 // log 3322 $atts = array( 3323 'outcome' => 1, 3324 'line' => __LINE__, 3325 'function' => __FUNCTION__, 3326 'file' => __FILE__, 3327 'userid' => get_current_user_id(), 3328 'type' => 'general', 3329 'category' => 'dataevent', 3330 'action' => __( "Source directory has been checked for new files but none found for source ID $source_id.", 'csv2post' ), 3331 'priority' => 'normal', 3332 'triga' => 'manualrequest' 3333 ); 3334 3335 self::newlog( $atts ); 3336 3214 3337 3215 return $result_array; 3338 3216 } … … 3348 3226 $result_array['outcome'] = true; 3349 3227 $result_array['error'] = false;// normal operation should lead to a green notice 3350 $result_array['message'] = __( 'A new .csv file was found in your sources directory. The plugin has switched to the new file', 'csv2post' ); 3351 3352 // log 3353 $atts = array( 3354 'outcome' => 1, 3355 'line' => __LINE__, 3356 'function' => __FUNCTION__, 3357 'file' => __FILE__, 3358 'userid' => get_current_user_id(), 3359 'type' => 'general', 3360 'category' => 'dataevent', 3361 'action' => __( "Source directory check discovered a newer .csv file for source ID $source_id. The new file has been made the primary file.", 'csv2post' ), 3362 'priority' => 'normal', 3363 'triga' => 'manualrequest' 3364 ); 3365 3366 self::newlog( $atts ); 3228 $result_array['message'] = __( 'A new .csv file was found in your sources directory. The plugin has switched to the new file', 'csv2post' ); 3367 3229 } 3368 3230 } -
csv-2-post/trunk/classes/class-install.php
r1355720 r1437051 41 41 register_deactivation_hook( CSV2POST_ABSPATH . 'csv-2-post.php', array( $this, 'deactivate_plugin' ) ); 42 42 43 // register webtechglobal_log table44 add_action( 'init', array( $this, 'register_webtechglobal_log_table' ) );45 add_action( 'switch_blog', array( $this, 'register_webtechglobal_log_table' ) );46 $this->register_webtechglobal_log_table(); // register tables manually as the hook may have been missed47 48 43 // register c2pprojects table 49 44 add_action( 'init', array( $this, 'register_c2pprojects_table' ) ); … … 57 52 } 58 53 59 function register_webtechglobal_log_table() {60 global $wpdb;61 $wpdb->webtechglobal_log = "{$wpdb->prefix}webtechglobal_log";62 }63 64 54 function register_c2pprojects_table() { 65 55 global $wpdb; … … 79 69 * @author Ryan R. Bayne 80 70 * @package CSV 2 POST 81 * @version 1. 371 * @version 1.4 82 72 * 83 73 * @todo put all tables into their own function as done with log table … … 89 79 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 90 80 91 self::webtechglobal_log();92 93 81 // TODO 2 Task: after problems with this query I put it on a single line 94 82 // then the problems stopped. But it should be able to go over multiple … … 96 84 97 85 // c2pprojects 98 $sql_create_table = "CREATE TABLE {$wpdb->c2pprojects} ( 86 $sql_create_table = "CREATE TABLE {$wpdb->c2pprojects} ( 99 87 projectid bigint(5) unsigned NOT NULL AUTO_INCREMENT, 100 88 projectname varchar(45) DEFAULT NULL, 101 89 status int(1) unsigned DEFAULT 1, 102 90 timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 103 source1 int(5) unsigned DEFAULT 0,104 source2 int(5) unsigned DEFAULT 0,105 source3 int(5) unsigned DEFAULT 0,106 source4 int(5) unsigned DEFAULT 0,107 source5 int(5) unsigned DEFAULT 0,108 lockcontent tinyint(1) unsigned DEFAULT 0,91 source1 int(5) unsigned DEFAULT '0', 92 source2 int(5) unsigned DEFAULT '0', 93 source3 int(5) unsigned DEFAULT '0', 94 source4 int(5) unsigned DEFAULT '0', 95 source5 int(5) unsigned DEFAULT '0', 96 lockcontent tinyint(1) unsigned DEFAULT '0', 109 97 lockmeta tinyint(1) unsigned DEFAULT '0', 110 98 datatreatment varchar(50) DEFAULT 'single', 111 99 projectsettings longtext DEFAULT NULL, 112 100 settingschange DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', 113 UNIQUE KEY (projectid)114 ) $charset_collate; ";101 UNIQUE KEY (projectid) 102 ) $charset_collate; "; 115 103 dbDelta( $sql_create_table ); 116 104 // projectid - users will see this and use it to identify their project … … 152 140 // directory - directory for sources with multiple files at once or new files being added to directory and being switched to 153 141 } 154 155 /** 156 * Global WebTechGlobal log table as used in all WTG plugins. 157 * This approach helps to keep the database tidy, while still providing 158 * an still improving log system and with all log entries in a single table. 159 * Behaviours relating to integration of these plugins can be spotted easier. 160 * 161 * @author Ryan R. Bayne 162 * @package Training Tools 163 * @since 0.0.3 164 * @version 1.0 165 */ 166 public function webtechglobal_log() { 167 global $charset_collate,$wpdb; 168 169 // webtechglobal_log - log everything in this table and use the data for multiple purposes 170 $sql_create_table = "CREATE TABLE {$wpdb->webtechglobal_log} ( 171 row_id bigint(20) unsigned NOT NULL AUTO_INCREMENT, 172 service varchar(250) DEFAULT 'trainingtools', 173 outcome tinyint(1) unsigned NOT NULL DEFAULT 1, 174 timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 175 line int(11) unsigned DEFAULT NULL, 176 file varchar(250) DEFAULT NULL, 177 function varchar(250) DEFAULT NULL, 178 sqlresult blob,sqlquery varchar(45) DEFAULT NULL, 179 sqlerror mediumtext, 180 wordpresserror mediumtext, 181 screenshoturl varchar(500) DEFAULT NULL, 182 userscomment mediumtext, 183 page varchar(45) DEFAULT NULL, 184 version varchar(45) DEFAULT NULL, 185 panelid varchar(45) DEFAULT NULL, 186 panelname varchar(45) DEFAULT NULL, 187 tabscreenid varchar(45) DEFAULT NULL, 188 tabscreenname varchar(45) DEFAULT NULL, 189 dump longblob,ipaddress varchar(45) DEFAULT NULL, 190 userid int(11) unsigned DEFAULT NULL, 191 comment mediumtext,type varchar(45) DEFAULT NULL, 192 category varchar(45) DEFAULT NULL, 193 action varchar(45) DEFAULT NULL, 194 priority varchar(45) DEFAULT NULL, 195 triga varchar(45) DEFAULT NULL, 196 PRIMARY KEY (row_id) ) $charset_collate; "; 197 198 dbDelta( $sql_create_table ); 199 200 // row_id 201 // service - the plugin, theme or web service triggering log entry 202 // outcome - set a positive (1) or negative (0) outcome 203 // timestamp 204 // line - __LINE__ 205 // file - __FILE__ 206 // function - __FUNCTION__ 207 // sqlresult - return from the query (dont go mad with this and store large or sensitive data where possible) 208 // sqlquery - the query as executed 209 // sqlerror - if failed MySQL error in here 210 // wordpresserror - if failed store WP error 211 // screenshoturl - if screenshot taking and uploaded 212 // userscomment - if user is testing they can submit a comment with error i.e. what they done to cause it 213 // page - plugin page ID i.e. c2pdownloads 214 // version - version of the plugin (plugin may store many logs over many versions) 215 // panelid - (will be changed to formid i.e. savebasicsettings) 216 // panelname - (will be changed to formname i.e Save Basic Settings) 217 // tabscreenid - the tab number i.e. 0 or 1 or 5 218 // tabscreenname - the on screen name of the tab in question, if any i.e. Downloads Overview 219 // dump - anything the developer thinks will help with debugging or training 220 // ipaddress - security side of things, record who is using the site 221 // userid - if user logged into WordPress 222 // comment - developers comment in-code i.e. recommendation on responding to the log entry 223 // type - general|error|trace 224 // category - any term that suits the section or system 225 // action - what was being attempted, if known 226 // priority - low|medium|high (low should be default, medium if the log might help improve the plugin or user experience or minor PHP errors, high for critical errors especially security related 227 // triga - (trigger but that word is taking) not sure we need this 228 } 229 142 230 143 /** 231 144 * reinstall all database tables in one go -
csv-2-post/trunk/classes/class-requests.php
r1372216 r1437051 36 36 // create class objects 37 37 $this->CONFIG = new CSV2POST_Configuration(); 38 // TODO Task: stop using $this->CSV2POST if possible38 // TODO Task: stop using $this->CSV2POST there was complication in removing it but it can be done 39 39 $this->CSV2POST = CSV2POST::load_class( 'CSV2POST', 'class-csv2post.php', 'classes' ); # plugin specific functions 40 40 $this->UI = $this->CSV2POST->load_class( 'CSV2POST_UI', 'class-ui.php', 'classes' ); # interface, mainly notices … … 47 47 $this->SCHEDULE = $this->CSV2POST->load_class( "CSV2POST_Schedule", "class-pluginmenu.php", 'classes','pluginmenu' ); 48 48 $this->DATA = $this->CSV2POST->load_class( "CSV2POST_Data", "class-data.php", 'classes','pluginmenu' ); 49 $this->LOG = $this->CSV2POST->load_class( "CSV2POST_Log", "class-log.php", 'classes','pluginmenu' ); 50 49 51 50 // set current project values 52 51 if( isset( $csv2post_settings['currentproject'] ) && $csv2post_settings['currentproject'] !== false ) { … … 128 127 129 128 // if $overall_result includes a single failure then there is no need to call the final function 130 if( $post_result === false ) { 131 132 // log 133 $atts = array( 134 'outcome' => 1, 135 'line' => __LINE__, 136 'function' => __FUNCTION__, 137 'file' => __FILE__, 138 'userid' => get_current_user_id(), 139 'type' => 'trace', 140 'category' => 'usertrace', 141 'action' => __( 'Form submit request rejected after security and validation applied for form ID ' . $_POST['csv2post_form_formid'], 'csv2post' ), 142 'priority' => 'normal', 143 'triga' => 'manualrequest' 144 ); 145 146 $this->LOG->newlog( $atts ); 147 129 if( $post_result === false ) { 148 130 return false; 149 131 } … … 152 134 // handle a situation where the submitted form requests a function that does not exist 153 135 if( !method_exists( $this, $function_name ) ){ 154 155 // log156 $atts = array(157 'outcome' => 1,158 'line' => __LINE__,159 'function' => __FUNCTION__,160 'file' => __FILE__,161 'userid' => get_current_user_id(),162 'type' => 'error',// using error is enough to attract attention to the problem163 'category' => 'usertrace',// still use usertrace so that the negative event the user witnessed can be considered when communicating with the user164 'action' => __( 'Requested function/method could not be found. This should be reported to WebTechGlobal.', 'csv2post' ),165 'priority' => 'high',166 'triga' => 'manualrequest'167 );168 169 $this->LOG->newlog( $atts );170 171 136 wp_die( sprintf( __( "The method for processing your request was not found. This can usually be resolved quickly. Please report method %s does not exist. <a href='https://www.youtube.com/watch?v=vAImGQJdO_k' target='_blank'>Watch a video</a> explaining this problem.", 'wtgpluginframework' ), 172 137 $function_name) ); … … 181 146 182 147 /** 183 * form processing function148 * Processes a request by form submission. 184 149 * 185 150 * @author Ryan Bayne … … 193 158 194 159 /** 195 * form processing function160 * Processes a request by form submission. 196 161 * 197 162 * @author Ryan Bayne … … 205 170 206 171 /** 207 * form processing function172 * Processes a request by form submission. 208 173 * 209 174 * @author Ryan Bayne … … 429 394 430 395 /** 431 * form processing function396 * Processes a request by form submission. 432 397 * 433 398 * @author Ryan Bayne … … 441 406 442 407 /** 443 * form processing function408 * Processes a request by form submission. 444 409 * 445 410 * @author Ryan Bayne … … 476 441 // unset current project setting 477 442 unset( $csv2post_settings['currentproject'] ); 478 $this->CSV2POST->update_settings( $csv2post_settings ); 479 480 // log 481 $atts = array( 482 'outcome' => 1, 483 'line' => __LINE__, 484 'function' => __FUNCTION__, 485 'file' => __FILE__, 486 'userid' => get_current_user_id(), 487 'type' => 'general', 488 'category' => 'projectchange', 489 'action' => sprintf( __( 'Project deleted. The projects ID is %d.', 'csv2post' ), $_POST['projectid'] ), 490 'priority' => 'high', 491 'triga' => 'manualrequest' 492 ); 493 494 $this->LOG->newlog( $atts ); 495 443 $this->CSV2POST->update_settings( $csv2post_settings ); 496 444 $this->UI->create_notice( __( 'Your project was deleted.' ), 'success', 'Small', __( 'Success' ) ); 497 445 } … … 567 515 568 516 /** 569 * form processing function517 * Processes a request by form submission. 570 518 * 571 519 * @author Ryan Bayne … … 600 548 601 549 /** 602 * form processing function550 * Processes a request by form submission. 603 551 * 604 552 * @author Ryan Bayne … … 633 581 634 582 /** 635 * form processing function583 * Processes a request by form submission. 636 584 * 637 585 * @author Ryan Bayne … … 666 614 667 615 /** 668 * form processing function616 * Processes a request by form submission. 669 617 * 670 618 * @author Ryan Bayne … … 699 647 700 648 /** 701 * form processing function649 * Processes a request by form submission. 702 650 * 703 651 * @author Ryan Bayne … … 732 680 733 681 /** 734 * form processing function682 * Processes a request by form submission. 735 683 * 736 684 * @author Ryan Bayne … … 773 721 774 722 /** 775 * form processing function723 * Processes a request by form submission. 776 724 * 777 725 * @author Ryan Bayne … … 830 778 831 779 /** 832 * form processing function780 * Processes a request by form submission. 833 781 * 834 782 * @author Ryan Bayne … … 843 791 844 792 /** 845 * form processing function793 * Processes a request by form submission. 846 794 * 847 795 * @author Ryan Bayne … … 856 804 857 805 /** 858 * form processing function806 * Processes a request by form submission. 859 807 * 860 808 * @author Ryan Bayne … … 869 817 870 818 /** 871 * form processing function819 * Processes a request by form submission. 872 820 * 873 821 * @author Ryan Bayne … … 882 830 883 831 /** 884 * form processing function832 * Processes a request by form submission. 885 833 * 886 834 * @author Ryan Bayne … … 908 856 909 857 /** 910 * form processing function858 * Processes a request by form submission. 911 859 * 912 860 * @author Ryan Bayne … … 926 874 927 875 /** 928 * form processing function876 * Processes a request by form submission. 929 877 * 930 878 * @author Ryan Bayne … … 980 928 981 929 /** 982 * form processing function930 * Processes a request by form submission. 983 931 * 984 932 * @author Ryan Bayne … … 1007 955 1008 956 /** 1009 * form processing function957 * Processes a request by form submission. 1010 958 * 1011 959 * @author Ryan Bayne … … 1152 1100 1153 1101 /** 1154 * form processing function1102 * Processes a request by form submission. 1155 1103 * 1156 1104 * @author Ryan Bayne … … 1202 1150 1203 1151 /** 1204 * form processing function1152 * Processes a request by form submission. 1205 1153 * 1206 1154 * @author Ryan Bayne … … 1231 1179 1232 1180 /** 1233 * form processing function1181 * Processes a request by form submission. 1234 1182 * 1235 1183 * @author Ryan Bayne … … 1260 1208 1261 1209 /** 1262 * form processing function1210 * Processes a request by form submission. 1263 1211 * 1264 1212 * @author Ryan Bayne … … 1285 1233 1286 1234 /** 1287 * form processing function1235 * Processes a request by form submission. 1288 1236 * 1289 1237 * @author Ryan Bayne … … 1326 1274 1327 1275 /** 1328 * form processing function1276 * Processes a request by form submission. 1329 1277 * 1330 1278 * @author Ryan Bayne … … 1355 1303 1356 1304 /** 1357 * form processing function1305 * Processes a request by form submission. 1358 1306 * 1359 1307 * @author Ryan Bayne … … 1384 1332 1385 1333 /** 1386 * form processing function1334 * Processes a request by form submission. 1387 1335 * 1388 1336 * @author Ryan Bayne … … 1416 1364 1417 1365 /** 1418 * form processing function1366 * Processes a request by form submission. 1419 1367 * 1420 1368 * @author Ryan Bayne … … 1433 1381 1434 1382 /** 1435 * form processing function1383 * Processes a request by form submission. 1436 1384 * 1437 1385 * @author Ryan Bayne … … 1454 1402 1455 1403 /** 1456 * form processing function1404 * Processes a request by form submission. 1457 1405 * 1458 1406 * @author Ryan Bayne … … 1485 1433 1486 1434 /** 1487 * form processing function1435 * Processes a request by form submission. 1488 1436 * 1489 1437 * @author Ryan Bayne … … 1543 1491 1544 1492 /** 1545 * form processing function1493 * Processes a request by form submission. 1546 1494 * 1547 1495 * @author Ryan Bayne … … 1584 1532 1585 1533 /** 1586 * form processing function1534 * Processes a request by form submission. 1587 1535 * 1588 1536 * @author Ryan Bayne … … 1598 1546 1599 1547 /** 1600 * form processing function1548 * Processes a request by form submission. 1601 1549 * 1602 1550 * @author Ryan Bayne … … 1802 1750 1803 1751 $this->CSV2POST->create_posts( $csv2post_settings['currentproject'], $total ); 1804 1805 // log 1806 $atts = array( 1807 'outcome' => 1, 1808 'line' => __LINE__, 1809 'function' => __FUNCTION__, 1810 'file' => __FILE__, 1811 'userid' => get_current_user_id(), 1812 'type' => 'general', 1813 'category' => 'projectchange', 1814 'action' => sprintf( __( 'User requested %s posts to be created.', 'csv2post' ), $total ), 1815 'priority' => 'normal', 1816 'triga' => 'manualrequest' 1817 ); 1818 1819 $this->LOG->newlog( $atts ); 1820 1752 1821 1753 $this->UI->create_notice( __( 'Post creation procedure has finished. This notice marks the end of the procedure whatever the outcome.', 'csv2post' ), 'success', 'Small', __( 'Post Creation Ended', 'csv2post' ) ); 1822 1754 } … … 1836 1768 1837 1769 $total = 50; 1838 1839 // log 1840 $atts = array( 1841 'outcome' => 1, 1842 'line' => __LINE__, 1843 'function' => __FUNCTION__, 1844 'file' => __FILE__, 1845 'userid' => get_current_user_id(), 1846 'type' => 'general', 1847 'category' => 'projectchange', 1848 'action' => sprintf( __( 'User requested %s posts to be made.', 'csv2post' ), $total ), 1849 'priority' => 'normal', 1850 'triga' => 'manualrequest' 1851 ); 1852 1853 $this->LOG->newlog( $atts ); 1854 1770 1855 1771 $this->CSV2POST->create_posts( $csv2post_settings['currentproject'], $total ); 1856 1772 } … … 1873 1789 1874 1790 /** 1875 * form processing function1791 * Processes a request by form submission. 1876 1792 * 1877 1793 * @author Ryan Bayne … … 1898 1814 1899 1815 /** 1900 * form processing function1816 * Processes a request by form submission. 1901 1817 * 1902 1818 * @author Ryan Bayne … … 1924 1840 1925 1841 /** 1926 * form processing function1842 * Processes a request by form submission. 1927 1843 * 1928 1844 * @author Ryan Bayne … … 1960 1876 1961 1877 /** 1962 * form processing function1878 * Processes a request by form submission. 1963 1879 * 1964 1880 * @author Ryan Bayne … … 1993 1909 1994 1910 /** 1995 * form processing function1911 * Processes a request by form submission. 1996 1912 * 1997 1913 * @author Ryan Bayne … … 2007 1923 2008 1924 /** 2009 * form processing function1925 * Processes a request by form submission. 2010 1926 * 2011 1927 * @author Ryan Bayne … … 2032 1948 2033 1949 /** 2034 * form processing function1950 * Processes a request by form submission. 2035 1951 * 2036 1952 * @author Ryan Bayne … … 2052 1968 2053 1969 /** 2054 * form processing function1970 * Processes a request by form submission. 2055 1971 * 2056 1972 * @author Ryan Bayne … … 2085 2001 2086 2002 /** 2087 * form processing function2003 * Processes a request by form submission. 2088 2004 * 2089 2005 * @author Ryan Bayne … … 2367 2283 2368 2284 /** 2369 * form processing function2285 * Processes a request by form submission. 2370 2286 * 2371 2287 * @author Ryan Bayne … … 2408 2324 post ID have been removed from the projects database table so that you can re-create the posts."), 'success', 'Small', __( 'Posts Deleted' ) ); 2409 2325 } 2410 2411 // log2412 $atts = array(2413 'outcome' => 1,2414 'line' => __LINE__,2415 'function' => __FUNCTION__,2416 'file' => __FILE__,2417 'userid' => get_current_user_id(),2418 'type' => 'general',2419 'category' => 'projectchange',2420 'action' => sprintf( __( 'User requested %s posts to be deleted.', 'csv2post' ), $limit ),2421 'priority' => 'normal',2422 'triga' => 'manualrequest'2423 );2424 2425 $this->LOG->newlog( $atts );2426 2326 } 2427 2327 2428 2328 /** 2429 * form processing function2329 * Processes a request by form submission. 2430 2330 * 2431 2331 * @author Ryan Bayne … … 2437 2337 global $wpdb, $csv2post_settings; 2438 2338 $result = $wpdb->query( 'UPDATE `'.$this->DB->get_project_main_table( $csv2post_settings['currentproject'] ).'` SET `c2p_postid` = 0' ); 2439 2440 // log2441 $atts = array(2442 'outcome' => 1,2443 'line' => __LINE__,2444 'function' => __FUNCTION__,2445 'file' => __FILE__,2446 'userid' => get_current_user_id(),2447 'type' => 'general',2448 'category' => 'dataevent',2449 'action' => sprintf( __( 'Imported data reset for project ID %s and ready to use again.', 'csv2post' ), $csv2post_settings['currentproject'] ),2450 'priority' => 'normal',2451 'triga' => 'manualrequest',2452 'dump' => $result,2453 );2454 2455 $this->LOG->newlog( $atts );2456 2457 2339 $this->UI->create_notice( "The plugin removed all post ID's from a total 2458 2340 of $result rows in your imported data for the current project. The rows … … 2465 2347 2466 2348 /** 2467 * form processing function2349 * Processes a request by form submission. 2468 2350 * 2469 2351 * @author Ryan Bayne … … 2526 2408 $this->CSV2POST->update_sources_withprojects( $projectid, $sourceid_array ); 2527 2409 2528 $this->UI->create_notice( 'Your project has been created and the ID is ' . $projectid . '. The default project name is ' . $project_name . ' which you can change using project settings.', 'success', 'Small', __( 'Project Created' ) ); 2529 2530 // log 2531 $atts = array( 2532 'outcome' => 1, 2533 'line' => __LINE__, 2534 'function' => __FUNCTION__, 2535 'file' => __FILE__, 2536 'userid' => get_current_user_id(), 2537 'type' => 'general', 2538 'category' => 'projectchange', 2539 'action' => sprintf( __( 'New project created with ID %s.', 'csv2post' ), $projectid ), 2540 'priority' => 'normal', 2541 'triga' => 'manualrequest' 2542 ); 2543 2544 $this->LOG->newlog( $atts ); 2410 $this->UI->create_notice( 'Your project has been created and the ID is ' . $projectid . '. The default project name is ' . $project_name . ' which you can change using project settings.', 'success', 'Small', __( 'Project Created' ) ); 2545 2411 } 2546 2412 … … 2550 2416 2551 2417 /** 2552 * form processing function2418 * Processes a request by form submission. 2553 2419 * 2554 2420 * @author Ryan Bayne … … 3039 2905 $this->CSV2POST->create_project_table( $files_array[1]['tablename'], $sqlheaders_array ); 3040 2906 self::a_table_was_created( $files_array[1]['tablename'] ); 3041 3042 // log 3043 $atts = array( 3044 'outcome' => 1, 3045 'line' => __LINE__, 3046 'function' => __FUNCTION__, 3047 'file' => __FILE__, 3048 'userid' => get_current_user_id(), 3049 'type' => 'general', 3050 'category' => 'dataevent', 3051 'action' => __( 'Created URL .csv data source.', 'csv2post' ), 3052 'priority' => 'normal', 3053 'triga' => 'manualrequest' 3054 ); 3055 3056 $this->LOG->newlog( $atts ); 3057 2907 3058 2908 $this->UI->create_notice( sprintf( __( 'Your new source of data has been 3059 2909 setup. You can now create a project using this source. The source ID … … 3191 3041 $this->CSV2POST->create_project_table( $files_array[1]['tablename'], $sqlheaders_array ); 3192 3042 self::a_table_was_created( $files_array[1]['tablename'] ); 3193 3194 // log 3195 $atts = array( 3196 'outcome' => 1, 3197 'line' => __LINE__, 3198 'function' => __FUNCTION__, 3199 'file' => __FILE__, 3200 'userid' => get_current_user_id(), 3201 'type' => 'general', 3202 'category' => 'dataevent', 3203 'action' => __( 'Created data source using uploaded .csv file.', 'csv2post' ), 3204 'priority' => 'normal', 3205 'triga' => 'manualrequest' 3206 ); 3207 3208 $this->LOG->newlog( $atts ); 3209 3043 3210 3044 $this->UI->create_notice( __( 'Your new source of data has been setup. 3211 3045 You can now create a project using this source. The source ID … … 3338 3172 $this->CSV2POST->create_project_table( $files_array[1]['tablename'], $sqlheaders_array ); 3339 3173 self::a_table_was_created( $files_array[1]['tablename'] ); 3340 3341 // log 3342 $atts = array( 3343 'outcome' => 1, 3344 'line' => __LINE__, 3345 'function' => __FUNCTION__, 3346 'file' => __FILE__, 3347 'userid' => get_current_user_id(), 3348 'type' => 'general', 3349 'category' => 'dataevent', 3350 'action' => __( 'Created data-source using local file that was already on the server.', 'csv2post' ), 3351 'priority' => 'normal', 3352 'triga' => 'manualrequest' 3353 ); 3354 3355 $this->LOG->newlog( $atts ); 3356 3174 3357 3175 $this->UI->create_notice( __( 'Your new source of data has been setup. 3358 3176 You can now create a project using this source. The source … … 3550 3368 $csv2post_settings['directorysources'][$path]['name'] = $_POST['newsourcename4']; 3551 3369 $this->CSV2POST->update_settings( $csv2post_settings ); 3552 3553 // make log entry under dataevent category 3554 $atts = array( 3555 'outcome' => 1, 3556 'line' => __LINE__, 3557 'function' => __FUNCTION__, 3558 'file' => __FILE__, 3559 'userid' => get_current_user_id(), 3560 'general' => 'general', 3561 'category' => 'dataevent', 3562 'action' => __( 'Directory data source created.', 'csv2post' ), 3563 'priority' => 'normal', 3564 'triga' => 'manualrequest' 3565 ); 3566 3567 $this->LOG->newlog( $atts ); 3568 3370 3569 3371 // finishing notice 3570 3372 $this->UI->create_notice( __( 'All done! A total of ' . $total_new_datasources . ' -
csv-2-post/trunk/classes/class-schedule.php
r1355720 r1437051 27 27 $this->DB = $this->CONFIG->load_class( 'CSV2POST_DB', 'class-wpdb.php', 'classes' ); 28 28 $this->DATA = $this->CONFIG->load_class( 'CSV2POST_Data', 'class-data.php', 'classes' ); 29 $this->LOG = $this->CONFIG->load_class( 'CSV2POST_Log', 'class-log.php', 'classes' );30 29 $this->UI = $this->CONFIG->load_class( 'CSV2POST_UI', 'class-ui.php', 'classes' ); 31 30 … … 131 130 return false; 132 131 } 133 134 // log135 $atts = array(136 'outcome' => 1,137 'line' => __LINE__,138 'function' => __FUNCTION__,139 'file' => __FILE__,140 'type' => 'general',141 'category' => 'dataevent',142 143 'action' => __( "Automatic data import is using source $source_id144 for project $project_id and will attempt data import.", 'csv2post' ),145 146 'priority' => 'normal',147 'triga' => 'automatic'148 );149 150 $this->CONFIG->newlog( $atts );151 132 152 133 // import data … … 193 174 194 175 break; 195 } 196 197 // log 198 $atts = array( 199 'outcome' => 1, 200 'line' => __LINE__, 201 'function' => __FUNCTION__, 202 'file' => __FILE__, 203 'type' => 'general', 204 'category' => 'dataevent', 205 'action' => __( "Automatic data update is using source $source_id 206 for project $project_id and will attempt data re-import.", 'csv2post' ), 207 'priority' => 'normal', 208 'triga' => 'automatic' 209 ); 210 211 $this->CONFIG->newlog( $atts ); 176 } 212 177 213 178 // import data … … 298 263 $autoblog->start(); 299 264 } 300 301 // log 302 $atts = array( 303 'outcome' => 1, 304 'line' => __LINE__, 305 'function' => __FUNCTION__, 306 'file' => __FILE__, 307 'type' => 'general', 308 'category' => 'postsevent', 309 'action' => __( "Up to $foreach_done posts may have been created.", 'csv2post' ), 310 'priority' => 'normal', 311 'triga' => 'manualrequest' 312 ); 313 314 $this->LOG->newlog( $atts ); 315 265 316 266 $this->UI->create_notice( __( "Normally automated functions would not 317 267 generate a user notice but this is to make testing easier. The post … … 398 348 $autoblog->start(); 399 349 } 400 401 // log 402 $atts = array( 403 'outcome' => 1, 404 'line' => __LINE__, 405 'function' => __FUNCTION__, 406 'file' => __FILE__, 407 'userid' => get_current_user_id(), 408 'type' => 'general', 409 'category' => 'postsevent', 410 'action' => __( "Up to $foreach_done posts may have been updated.", 'csv2post' ), 411 'priority' => 'normal', 412 'triga' => 'manualrequest' 413 ); 414 415 $this->LOG->newlog( $atts ); 416 $this->UI->create_notice( __( 'Posts may have been updated. This 417 notice will not be generated for any user during automated events and 418 is only to help make testing clearer.' ), 'info', 'Small', 419 __( 'Testing Complete: Posts Updated', 'csv2post' ) ); 420 return false; 350 351 $this->UI->create_notice( __( 'Posts may have been updated. This 352 notice will not be generated for any user during automated events and 353 is only to help make testing clearer.' ), 'info', 'Small', 354 __( 'Testing Complete: Posts Updated', 'csv2post' ) ); 355 return false; 421 356 } 422 357 -
csv-2-post/trunk/classes/class-ui.php
r1355720 r1437051 2733 2733 } 2734 2734 2735 /**2736 * Lists tickets post type using standard WordPress list table2737 */2738 class CSV2POST_Log_Table extends WP_List_Table {2739 2740 /** ************************************************************************2741 * REQUIRED. Set up a constructor that references the parent constructor. We2742 * use the parent reference to set some default configs.2743 ***************************************************************************/2744 function __construct() {2745 global $status, $page;2746 2747 //Set parent defaults2748 parent::__construct( array(2749 'singular' => 'movie', //singular name of the listed records2750 'plural' => 'movies', //plural name of the listed records2751 'ajax' => false //does this table support ajax?2752 ) );2753 2754 }2755 2756 /** ************************************************************************2757 * Recommended. This method is called when the parent class can't find a method2758 * specifically build for a given column. Generally, it's recommended to include2759 * one method for each column you want to render, keeping your package class2760 * neat and organized. For example, if the class needs to process a column2761 * named 'title', it would first see if a method named $this->column_title()2762 * exists - if it does, that method will be used. If it doesn't, this one will2763 * be used. Generally, you should try to use custom column methods as much as2764 * possible.2765 *2766 * Since we have defined a column_title() method later on, this method doesn't2767 * need to concern itself with any column with a name of 'title'. Instead, it2768 * needs to handle everything else.2769 *2770 * For more detailed insight into how columns are handled, take a look at2771 * WP_List_Table::single_row_columns()2772 *2773 * @param array $item A singular item (one full row's worth of data)2774 * @param array $column_name The name/slug of the column to be processed2775 * @return string Text or HTML to be placed inside the column <td>2776 **************************************************************************/2777 function column_default( $item, $column_name){2778 2779 $attributes = "class=\"$column_name column-$column_name\"";2780 2781 switch( $column_name){2782 case 'row_id':2783 return $item['row_id'];2784 break;2785 case 'timestamp':2786 return $item['timestamp'];2787 break;2788 case 'outcome':2789 return $item['outcome'];2790 break;2791 case 'category':2792 echo $item['category'];2793 break;2794 case 'action':2795 echo $item['action'];2796 break;2797 case 'line':2798 echo $item['line'];2799 break;2800 case 'file':2801 echo $item['file'];2802 break;2803 case 'function':2804 echo $item['function'];2805 break;2806 case 'sqlresult':2807 echo $item['sqlresult'];2808 break;2809 case 'sqlquery':2810 echo $item['sqlquery'];2811 break;2812 case 'sqlerror':2813 echo $item['sqlerror'];2814 break;2815 case 'wordpresserror':2816 echo $item['wordpresserror'];2817 break;2818 case 'screenshoturl':2819 echo $item['screenshoturl'];2820 break;2821 case 'userscomment':2822 echo $item['userscomment'];2823 break;2824 case 'page':2825 echo $item['page'];2826 break;2827 case 'version':2828 echo $item['version'];2829 break;2830 case 'panelname':2831 echo $item['panelname'];2832 break;2833 case 'tabscreenname':2834 echo $item['tabscreenname'];2835 break;2836 case 'dump':2837 echo $item['dump'];2838 break;2839 case 'ipaddress':2840 echo $item['ipaddress'];2841 break;2842 case 'userid':2843 echo $item['userid'];2844 break;2845 case 'comment':2846 echo $item['comment'];2847 break;2848 case 'type':2849 echo $item['type'];2850 break;2851 case 'priority':2852 echo $item['priority'];2853 break;2854 case 'thetrigger':2855 echo $item['thetrigger'];2856 break;2857 2858 default:2859 return 'No column function or default setup in switch statement';2860 }2861 }2862 2863 /** ************************************************************************2864 * Recommended. This is a custom column method and is responsible for what2865 * is rendered in any column with a name/slug of 'title'. Every time the class2866 * needs to render a column, it first looks for a method named2867 * column_{$column_title} - if it exists, that method is run. If it doesn't2868 * exist, column_default() is called instead.2869 *2870 * This example also illustrates how to implement rollover actions. Actions2871 * should be an associative array formatted as 'slug'=>'link html' - and you2872 * will need to generate the URLs yourself. You could even ensure the links2873 *2874 *2875 * @see WP_List_Table::::single_row_columns()2876 * @param array $item A singular item (one full row's worth of data)2877 * @return string Text to be placed inside the column <td> (movie title only )2878 **************************************************************************/2879 /*2880 function column_title( $item){2881 2882 } */2883 2884 /** ************************************************************************2885 * REQUIRED! This method dictates the table's columns and titles. This should2886 * return an array where the key is the column slug (and class) and the value2887 * is the column's title text. If you need a checkbox for bulk actions, refer2888 * to the $columns array below.2889 *2890 * The 'cb' column is treated differently than the rest. If including a checkbox2891 * column in your table you must create a column_cb() method. If you don't need2892 * bulk actions or checkboxes, simply leave the 'cb' entry out of your array.2893 *2894 * @see WP_List_Table::::single_row_columns()2895 * @return array An associative array containing column information: 'slugs'=>'Visible Titles'2896 **************************************************************************/2897 function get_columns() {2898 $columns = array(2899 'row_id' => 'Row ID',2900 'timestamp' => 'Timestamp',2901 'category' => 'Category'2902 );2903 2904 if( isset( $this->action ) ){2905 $columns['action'] = 'Action';2906 }2907 2908 if( isset( $this->line ) ){2909 $columns['line'] = 'Line';2910 }2911 2912 if( isset( $this->file ) ){2913 $columns['file'] = 'File';2914 }2915 2916 if( isset( $this->function ) ){2917 $columns['function'] = 'Function';2918 }2919 2920 if( isset( $this->sqlresult ) ){2921 $columns['sqlresult'] = 'SQL Result';2922 }2923 2924 if( isset( $this->sqlquery ) ){2925 $columns['sqlquery'] = 'SQL Query';2926 }2927 2928 if( isset( $this->sqlerror ) ){2929 $columns['sqlerror'] = 'SQL Error';2930 }2931 2932 if( isset( $this->wordpresserror ) ){2933 $columns['wordpresserror'] = 'WP Error';2934 }2935 2936 if( isset( $this->screenshoturl ) ){2937 $columns['screenshoturl'] = 'Screenshot';2938 }2939 2940 if( isset( $this->userscomment ) ){2941 $columns['userscomment'] = 'Users Comment';2942 }2943 2944 if( isset( $this->columns_array->page ) ){2945 $columns['page'] = 'Page';2946 }2947 2948 if( isset( $this->version ) ){2949 $columns['version'] = 'Version';2950 }2951 2952 if( isset( $this->panelname ) ){2953 $columns['panelname'] = 'Panel Name';2954 }2955 2956 if( isset( $this->tabscreenid ) ){2957 $columns['tabscreenid'] = 'Screen ID';2958 }2959 2960 if( isset( $this->tabscreenname ) ){2961 $columns['tabscreenname'] = 'Screen Name';2962 }2963 2964 if( isset( $this->dump ) ){2965 $columns['dump'] = 'Dump';2966 }2967 2968 if( isset( $this->ipaddress) ){2969 $columns['ipaddress'] = 'IP Address';2970 }2971 2972 if( isset( $this->userid ) ){2973 $columns['userid'] = 'User ID';2974 }2975 2976 if( isset( $this->comment ) ){2977 $columns['comment'] = 'Comment';2978 }2979 2980 if( isset( $this->type ) ){2981 $columns['type'] = 'Type';2982 }2983 2984 if( isset( $this->priority ) ){2985 $columns['priority'] = 'Priority';2986 }2987 2988 if( isset( $this->thetrigger ) ){2989 $columns['thetrigger'] = 'Trigger';2990 }2991 2992 return $columns;2993 }2994 2995 /** ************************************************************************2996 * Optional. If you want one or more columns to be sortable (ASC/DESC toggle),2997 * you will need to register it here. This should return an array where the2998 * key is the column that needs to be sortable, and the value is db column to2999 * sort by. Often, the key and value will be the same, but this is not always3000 * the case (as the value is a column name from the database, not the list table).3001 *3002 * This method merely defines which columns should be sortable and makes them3003 * clickable - it does not handle the actual sorting. You still need to detect3004 * the ORDERBY and ORDER querystring variables within prepare_items_further() and sort3005 * your data accordingly (usually by modifying your query ).3006 *3007 * @return array An associative array containing all the columns that should be sortable: 'slugs'=>array( 'data_values',bool)3008 **************************************************************************/3009 function get_sortable_columns() {3010 $sortable_columns = array(3011 //'post_title' => array( 'post_title', false ), //true means it's already sorted3012 );3013 return $sortable_columns;3014 }3015 3016 /** ************************************************************************3017 * Optional. If you need to include bulk actions in your list table, this is3018 * the place to define them. Bulk actions are an associative array in the format3019 * 'slug'=>'Visible Title'3020 *3021 * If this method returns an empty value, no bulk action will be rendered. If3022 * you specify any bulk actions, the bulk actions box will be rendered with3023 * the table automatically on display().3024 *3025 * Also note that list tables are not automatically wrapped in <form> elements,3026 * so you will need to create those manually in order for bulk actions to function.3027 *3028 * @return array An associative array containing all the bulk actions: 'slugs'=>'Visible Titles'3029 **************************************************************************/3030 function get_bulk_actions() {3031 $actions = array(3032 3033 );3034 return $actions;3035 }3036 3037 /** ************************************************************************3038 * Optional. You can handle your bulk actions anywhere or anyhow you prefer.3039 * For this example package, we will handle it in the class to keep things3040 * clean and organized.3041 *3042 * @see $this->prepare_items_further()3043 **************************************************************************/3044 function process_bulk_action() {3045 3046 //Detect when a bulk action is being triggered...3047 if( 'delete'===$this->current_action() ) {3048 wp_die( 'Items deleted (or they would be if we had items to delete)!' );3049 }3050 3051 }3052 3053 /** ************************************************************************3054 * REQUIRED! This is where you prepare your data for display. This method will3055 * usually be used to query the database, sort and filter the data, and generally3056 * get it ready to be displayed. At a minimum, we should set $this->items and3057 * $this->set_pagination_args(), although the following properties and methods3058 * are frequently interacted with here...3059 *3060 * @global WPDB $wpdb3061 * @uses $this->_column_headers3062 * @uses $this->items3063 * @uses $this->get_columns()3064 * @uses $this->get_sortable_columns()3065 * @uses $this->get_pagenum()3066 * @uses $this->set_pagination_args()3067 **************************************************************************/3068 function prepare_items_further( $data, $per_page = 5) {3069 global $wpdb; //This is used only if making any database queries3070 3071 /**3072 * REQUIRED. Now we need to define our column headers. This includes a complete3073 * array of columns to be displayed (slugs & titles), a list of columns3074 * to keep hidden, and a list of columns that are sortable. Each of these3075 * can be defined in another method (as we've done here) before being3076 * used to build the value for our _column_headers property.3077 */3078 $columns = $this->get_columns();3079 $hidden = array();3080 $sortable = $this->get_sortable_columns();3081 3082 /**3083 * REQUIRED. Finally, we build an array to be used by the class for column3084 * headers. The $this->_column_headers property takes an array which contains3085 * 3 other arrays. One for all columns, one for hidden columns, and one3086 * for sortable columns.3087 */3088 $this->_column_headers = array( $columns, $hidden, $sortable);3089 3090 /**3091 * Optional. You can handle your bulk actions however you see fit. In this3092 * case, we'll handle them within our package just to keep things clean.3093 */3094 $this->process_bulk_action();3095 3096 /**3097 * REQUIRED for pagination. Let's figure out what page the user is currently3098 * looking at. We'll need this later, so you should always include it in3099 * your own package classes.3100 */3101 $current_page = $this->get_pagenum();3102 3103 /**3104 * REQUIRED for pagination. Let's check how many items are in our data array.3105 * In real-world use, this would be the total number of items in your database,3106 * without filtering. We'll need this later, so you should always include it3107 * in your own package classes.3108 */3109 $total_items = count( $data);3110 3111 /**3112 * The WP_List_Table class does not handle pagination for us, so we need3113 * to ensure that the data is trimmed to only the current page. We can use3114 * array_slice() to3115 */3116 $data = array_slice( $data,(( $current_page-1)*$per_page), $per_page);3117 3118 /**3119 * REQUIRED. Now we can add our *sorted* data to the items property, where3120 * it can be used by the rest of the class.3121 */3122 $this->items = $data;3123 3124 /**3125 * REQUIRED. We also have to register our pagination options & calculations.3126 */3127 $this->set_pagination_args( array(3128 'total_items' => $total_items, //WE have to calculate the total number of items3129 'per_page' => $per_page, //WE have to determine how many items to show on a page3130 'total_pages' => ceil( $total_items/$per_page) //WE have to calculate the total number of pages3131 ) );3132 }3133 }3134 3135 class CSV2POST_Projects_Table extends WP_List_Table {3136 3137 function __construct() {3138 global $status, $page;3139 3140 //Set parent defaults3141 parent::__construct( array(3142 'singular' => 'movie', //singular name of the listed records3143 'plural' => 'movies', //plural name of the listed records3144 'ajax' => false //does this table support ajax?3145 ) );3146 3147 }3148 3149 function column_default( $item, $column_name){3150 3151 $attributes = "class=\"$column_name column-$column_name\"";3152 3153 switch( $column_name){3154 case 'projectid':3155 return $item['projectid'];3156 break;3157 case 'projectname':3158 return $item['projectname'];3159 break;3160 case 'timestamp':3161 return $item['timestamp'];3162 break;3163 case 'source1':3164 return $item['source1'];3165 break;3166 case 'source2':3167 return $item['source2'];3168 break;3169 case 'source3':3170 return $item['source3'];3171 break;3172 default:3173 return 'No column function or default setup in switch statement';3174 }3175 }3176 3177 /*3178 function column_title( $item){3179 3180 } */3181 3182 function get_columns() {3183 $columns = array(3184 'projectid' => 'Project ID',3185 'projectname' => 'Project Name',3186 'timestamp' => 'Timestamp',3187 'source1' => 'Source 1',3188 'source2' => 'Source 2',3189 'source3' => 'Source 3'3190 );3191 3192 return $columns;3193 }3194 3195 function get_sortable_columns() {3196 $sortable_columns = array(3197 //'post_title' => array( 'post_title', false ), //true means it's already sorted3198 );3199 return $sortable_columns;3200 }3201 3202 function get_bulk_actions() {3203 $actions = array(3204 3205 );3206 return $actions;3207 }3208 3209 function process_bulk_action() {3210 3211 //Detect when a bulk action is being triggered...3212 if( 'delete'===$this->current_action() ) {3213 wp_die( 'Items deleted (or they would be if we had items to delete)!' );3214 }3215 3216 }3217 3218 function prepare_items_further( $data, $per_page = 5) {3219 global $wpdb; //This is used only if making any database queries3220 3221 $columns = $this->get_columns();3222 $hidden = array();3223 $sortable = $this->get_sortable_columns();3224 3225 $this->_column_headers = array( $columns, $hidden, $sortable);3226 3227 $this->process_bulk_action();3228 3229 $current_page = $this->get_pagenum();3230 3231 $total_items = count( $data);3232 3233 $data = array_slice( $data,(( $current_page-1)*$per_page), $per_page);3234 3235 $this->items = $data;3236 3237 $this->set_pagination_args( array(3238 'total_items' => $total_items, //WE have to calculate the total number of items3239 'per_page' => $per_page, //WE have to determine how many items to show on a page3240 'total_pages' => ceil( $total_items/$per_page) //WE have to calculate the total number of pages3241 ) );3242 }3243 }3244 3245 2735 class CSV2POST_ProjectDataSources_Table extends WP_List_Table { 3246 2736 -
csv-2-post/trunk/classes/class-view.php
r1372216 r1437051 127 127 $this->PHP = $this->CSV2POST->load_class( 'CSV2POST_PHP', 'class-phplibary.php', 'classes' ); 128 128 $this->UI = $this->CSV2POST->load_class( 'CSV2POST_UI', 'class-ui.php', 'classes' ); 129 $this->LOG = $this->CSV2POST->load_class( 'CSV2POST_Log', 'class-log.php', 'classes' );130 129 $this->DB = CSV2POST::load_class( 'CSV2POST_DB', 'class-wpdb.php', 'classes' ); 131 130 $this->FORMS = CSV2POST::load_class( 'CSV2POST_FORMS', 'class-forms.php', 'classes' ); … … 515 514 } 516 515 517 $current_user = get_currentuserinfo(); 518 519 // log users visit to page 520 $atts = array( 521 'outcome' => 1, 522 'line' => __LINE__, 523 'function' => __FUNCTION__, 524 'file' => __FILE__, 525 'userid' => get_current_user_id(), 526 'type' => 'trace',// using trace allows these log entries to be hidden easier 527 'category' => 'usertrace', 528 'action' => sprintf( __( "User named %s visited admin page named %s", 'csv2post' ), $current_user, $this->menu_array[ $admin_page ]['title'] ), 529 'priority' => 'low', 530 'triga' => 'manualrequest' 531 ); 532 533 $this->LOG->newlog( $atts ); 534 516 $current_user = wp_get_current_user(); 517 535 518 // view header - includes notices output and some admin side automation such as conflict prevention 536 519 $this->CSV2POST->pageheader( $this->menu_array[ $admin_page ]['title'], 0); -
csv-2-post/trunk/classes/class-wpdb.php
r1252652 r1437051 86 86 * @package CSV 2 POST 87 87 * @since 7.0.0 88 * @version 1. 0.188 * @version 1.4 89 89 * 90 90 * @param string $tablename … … 94 94 global $wpdb; 95 95 $fieldss = ''; 96 $values s= '';96 $values = ''; 97 97 $first = true; 98 98 99 foreach( $fields as $field=>$value ) 99 100 { … … 103 104 { 104 105 $fieldss .= ' , '; 105 $values s.= ' , ';106 $values .= ' , '; 106 107 } 107 108 $fieldss .= " `$field` "; 108 $valuess .= " '" . $value ."' "; 109 } 110 111 $query = " INSERT INTO $tablename ( $fieldss ) VALUES ( $valuess )"; 109 $values .= " '" . $wpdb->escape( $value ) ."' "; 110 } 111 112 $query = $wpdb->prepare( " 113 INSERT INTO $tablename ( $fieldss ) 114 VALUES ( $values )", 115 $tablename, $fieldss, $values 116 ); 112 117 113 118 $wpdb->query( $query ); … … 121 126 * @package CSV 2 POST 122 127 * @since 8.1.3 123 * @version 1. 2128 * @version 1.4 124 129 */ 125 130 public function update( $tablename, $condition, $fields ){ … … 130 135 { 131 136 if( $first) $first = false; else $query .= ' , '; 132 $query .= " `$field` = '" . $ value."' ";137 $query .= " `$field` = '" . $wpdb->escape( $value ) ."' "; 133 138 } 134 139 … … 550 555 , ARRAY_A ); 551 556 return $results; 552 }553 554 /**555 * function not complete556 *557 * @author Ryan R. Bayne558 * @package CSV 2 POST559 * @since 7.0.0560 * @version 1.1561 */562 public function log_queryactions() {563 global $wpdb;564 return $wpdb->get_results( 'SELECT DISTINCT action FROM '.$wpdb->prefix.'webtechglobal_log',ARRAY_A );565 557 } 566 558 -
csv-2-post/trunk/csv-2-post.php
r1372216 r1437051 2 2 /* 3 3 Plugin Name: CSV 2 POST 4 Version: 8.2.1 14 Version: 8.2.13 5 5 Plugin URI: http://www.webtechglobal.co.uk/csv-2-post 6 6 Description: CSV 2 POST data importer for WordPress by Ryan R. Bayne. 7 7 Author: WebTechGlobal 8 8 Author URI: http://www.webtechglobal.co.uk/ 9 Last Updated: February20169 Last Updated: June 2016 10 10 Text Domain: csv2post 11 11 Domain Path: /languages … … 39 39 40 40 // define constants 41 if(!defined( "CSV2POST_VERSION") ){define( "CSV2POST_VERSION", '8.2.1 1' );}41 if(!defined( "CSV2POST_VERSION") ){define( "CSV2POST_VERSION", '8.2.13' );} 42 42 if(!defined( "CSV2POST_TITLE") ){define( "CSV2POST_TITLE", 'CSV 2 POST' );} 43 43 if(!defined( "CSV2POST__FILE__") ){define( "CSV2POST__FILE__", __FILE__);} … … 63 63 // require very common classes and finally the main class for loading the plugin 64 64 require_once( CSV2POST_ABSPATH . 'classes/class-wpdb.php' ); 65 require_once( CSV2POST_ABSPATH . 'classes/class-log.php' );66 65 require_once( CSV2POST_ABSPATH . 'classes/class-configuration.php' ); 67 66 require_once( CSV2POST_ABSPATH . 'classes/class-csv2post.php' ); -
csv-2-post/trunk/readme.txt
r1372216 r1437051 1 1 === Plugin Name === 2 2 Contributors: WebTechGlobal 3 Donate link: http ://www.webtechglobal.co.uk3 Donate link: https://www.patreon.com/ryanbayne 4 4 License: GPLv2 or later 5 5 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 125 125 126 126 == Changelog == 127 = 8.2.13 NOT RELEASED = 128 * Feature Changes 129 * None 130 * Technical Changes 131 * class-log.php removed and the approach to logging will be a lighter solution. 132 * uninstall.php file added. 133 * Replaced depreciated get_currentuserinfo() with wp_get_current_user(). 134 135 = 8.2.12 = 136 * Feature Changes 137 * None 138 * Technical Changes 139 * Changed lockmeta tinyint(1) unsigned DEFAULT '0', 140 * to 141 * lockmeta tinyint(1) unsigned DEFAULT 0, 142 * in attempt to fix issue with dbDelta() which causes dbDelta() to 143 * attempt to change the datatreatment column. 144 127 145 = 8.2.11 = 128 146 * Feature Changes
Note: See TracChangeset
for help on using the changeset viewer.