Changeset 3255346
- Timestamp:
- 03/13/2025 12:09:08 PM (13 months ago)
- Location:
- gitium
- Files:
-
- 58 added
- 14 edited
-
tags/1.1.0 (added)
-
tags/1.1.0/functions.php (added)
-
tags/1.1.0/gitium-webhook.php (added)
-
tags/1.1.0/gitium.php (added)
-
tags/1.1.0/img (added)
-
tags/1.1.0/img/gitium.png (added)
-
tags/1.1.0/img/gitium.svg (added)
-
tags/1.1.0/inc (added)
-
tags/1.1.0/inc/class-git-wrapper.php (added)
-
tags/1.1.0/inc/class-gitium-admin.php (added)
-
tags/1.1.0/inc/class-gitium-help.php (added)
-
tags/1.1.0/inc/class-gitium-menu-bubble.php (added)
-
tags/1.1.0/inc/class-gitium-menu.php (added)
-
tags/1.1.0/inc/class-gitium-requirements.php (added)
-
tags/1.1.0/inc/class-gitium-submenu-commits.php (added)
-
tags/1.1.0/inc/class-gitium-submenu-configure.php (added)
-
tags/1.1.0/inc/class-gitium-submenu-settings.php (added)
-
tags/1.1.0/inc/class-gitium-submenu-status.php (added)
-
tags/1.1.0/inc/ssh-git (added)
-
tags/1.1.0/js (added)
-
tags/1.1.0/js/copy-to-clipboard.js (added)
-
tags/1.1.0/languages (added)
-
tags/1.1.0/languages/gitium-es_ES.mo (added)
-
tags/1.1.0/languages/gitium-es_ES.po (added)
-
tags/1.1.0/languages/gitium-sr_RS.mo (added)
-
tags/1.1.0/languages/gitium-sr_RS.po (added)
-
tags/1.1.0/languages/gitium.pot (added)
-
tags/1.1.0/readme.txt (added)
-
tags/1.2.0 (added)
-
tags/1.2.0/functions.php (added)
-
tags/1.2.0/gitium-webhook.php (added)
-
tags/1.2.0/gitium.php (added)
-
tags/1.2.0/img (added)
-
tags/1.2.0/img/gitium.png (added)
-
tags/1.2.0/img/gitium.svg (added)
-
tags/1.2.0/inc (added)
-
tags/1.2.0/inc/class-git-wrapper.php (added)
-
tags/1.2.0/inc/class-gitium-admin.php (added)
-
tags/1.2.0/inc/class-gitium-help.php (added)
-
tags/1.2.0/inc/class-gitium-menu-bubble.php (added)
-
tags/1.2.0/inc/class-gitium-menu.php (added)
-
tags/1.2.0/inc/class-gitium-requirements.php (added)
-
tags/1.2.0/inc/class-gitium-submenu-commits.php (added)
-
tags/1.2.0/inc/class-gitium-submenu-configure.php (added)
-
tags/1.2.0/inc/class-gitium-submenu-settings.php (added)
-
tags/1.2.0/inc/class-gitium-submenu-status.php (added)
-
tags/1.2.0/inc/ssh-git (added)
-
tags/1.2.0/js (added)
-
tags/1.2.0/js/copy-to-clipboard.js (added)
-
tags/1.2.0/languages (added)
-
tags/1.2.0/languages/gitium-es_ES.mo (added)
-
tags/1.2.0/languages/gitium-es_ES.po (added)
-
tags/1.2.0/languages/gitium-sr_RS.mo (added)
-
tags/1.2.0/languages/gitium-sr_RS.po (added)
-
tags/1.2.0/languages/gitium.pot (added)
-
tags/1.2.0/readme.txt (added)
-
trunk/functions.php (modified) (2 diffs)
-
trunk/gitium-webhook.php (modified) (1 diff)
-
trunk/gitium.php (modified) (1 diff)
-
trunk/inc/class-git-wrapper.php (modified) (1 diff)
-
trunk/inc/class-gitium-admin.php (modified) (1 diff)
-
trunk/inc/class-gitium-help.php (modified) (1 diff)
-
trunk/inc/class-gitium-menu-bubble.php (modified) (1 diff)
-
trunk/inc/class-gitium-menu.php (modified) (1 diff)
-
trunk/inc/class-gitium-requirements.php (modified) (1 diff)
-
trunk/inc/class-gitium-submenu-commits.php (modified) (1 diff)
-
trunk/inc/class-gitium-submenu-configure.php (modified) (2 diffs)
-
trunk/inc/class-gitium-submenu-settings.php (modified) (2 diffs)
-
trunk/inc/class-gitium-submenu-status.php (modified) (3 diffs)
-
trunk/js (added)
-
trunk/js/copy-to-clipboard.js (added)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
gitium/trunk/functions.php
r3146858 r3255346 1 1 <?php 2 /* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com> 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License, version 2, as 6 published by the Free Software Foundation. 7 8 This program is distributed in the hope that it will be useful, 9 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 GNU General Public License for more details. 12 13 You should have received a copy of the GNU General Public License 14 along with this program; if not, write to the Free Software 15 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 */ 2 /** 3 * Gitium provides automatic git version control and deployment for 4 * your plugins and themes integrated into wp-admin. 5 * 6 * Copyright (C) 2014-2025 PRESSINFRA SRL <ping@presslabs.com> 7 * 8 * Gitium is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation, either version 3 of the License, or 11 * any later version. 12 * 13 * Gitium is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with Gitium. If not, see <http://www.gnu.org/licenses/>. 20 * 21 * @package Gitium 22 */ 17 23 18 24 function gitium_error_log( $message ) { … … 419 425 } 420 426 add_action( 'admin_init', 'gitium_admin_init' ); 427 428 add_action('admin_enqueue_scripts', 'enqueue_script_for_gitium_page'); 429 function enqueue_script_for_gitium_page($hook) { 430 // Check if the current page is your plugin's settings page 431 if ((isset($_GET['page']) && $_GET['page'] === 'gitium/gitium.php') || (isset($_GET['page']) && $_GET['page'] === 'gitium/gitium-settings.php')) { 432 // Enqueue your JavaScript file 433 wp_enqueue_script( 434 'my-plugin-script', // Handle for the script 435 plugin_dir_url(__FILE__) . 'js/copy-to-clipboard.js', // URL to the script 436 array('jquery'), // Dependencies 437 '1.1', // Version number 438 true // Load in footer 439 ); 440 } 441 } -
gitium/trunk/gitium-webhook.php
r3146858 r3255346 1 1 <?php 2 /* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com> 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License, version 2, as 6 published by the Free Software Foundation. 7 8 This program is distributed in the hope that it will be useful, 9 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 GNU General Public License for more details. 12 13 You should have received a copy of the GNU General Public License 14 along with this program; if not, write to the Free Software 15 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 */ 2 /** 3 * Gitium provides automatic git version control and deployment for 4 * your plugins and themes integrated into wp-admin. 5 * 6 * Copyright (C) 2014-2025 PRESSINFRA SRL <ping@presslabs.com> 7 * 8 * Gitium is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation, either version 3 of the License, or 11 * any later version. 12 * 13 * Gitium is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with Gitium. If not, see <http://www.gnu.org/licenses/>. 20 * 21 * @package Gitium 22 */ 17 23 18 24 header( 'Content-Type: text/html' ); 19 25 define( 'SHORTINIT', true ); 20 //$wordpress_loader = $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php';21 $wordpress_loader = filter_input(INPUT_SERVER, 'DOCUMENT_ROOT', FILTER_SANITIZE_FULL_SPECIAL_CHARS) . '/wp-load.php';22 26 23 require_once $wordpress_loader; 27 $current_dir = __DIR__; 28 29 // Define an array of possible WordPress root locations 30 $try_wp_roots = [ 31 getenv('DOCUMENT_ROOT'), 32 filter_input(INPUT_SERVER, 'DOCUMENT_ROOT', FILTER_SANITIZE_FULL_SPECIAL_CHARS), 33 realpath($current_dir . '/../../../../../'), 34 realpath($current_dir . '/../../../../'), 35 realpath($current_dir . '/../../../'), // Typical WordPress structure 36 realpath($current_dir . '/../../'), // Alternative structure 37 realpath($current_dir . '/../'), // Closer parent directory 38 $current_dir, // Fallback to current directory 39 ]; 40 41 $wordpress_loader = null; 42 43 foreach ($try_wp_roots as $root) { 44 if ($root && file_exists($root . '/wp-load.php')) { 45 $wordpress_loader = $root . '/wp-load.php'; 46 break; 47 } 48 } 49 50 if ($wordpress_loader) { 51 require_once $wordpress_loader; 52 } else { 53 die('Error: Unable to locate wp-load.php. Please verify your WordPress installation.'); 54 } 55 24 56 require_once __DIR__ . '/functions.php'; 25 57 require_once __DIR__ . '/inc/class-git-wrapper.php'; -
gitium/trunk/gitium.php
r3146858 r3255346 1 1 <?php 2 2 /** 3 * Plugin Name: Gitium 4 * Version: 1.0.7 5 * Author: Presslabs 6 * Author URI: https://www.presslabs.com 7 * License: GPL2 8 * Description: Keep all your code on git version control system. 9 * Text Domain: gitium 10 * Domain Path: /languages/ 3 * Plugin Name: Gitium 4 * Plugin URI: https://www.presslabs.com/gitium/ 5 * Description: Keep all your code on git version control system. 6 * Author: PRESSINFRA SRL 7 * Author URI: https://www.presslabs.com 8 * Text Domain: gitium 9 * Domain Path: /languages 10 * Version: 1.0.7 11 * License: GPL3 12 * 13 * Gitium provides automatic git version control and deployment for 14 * your plugins and themes integrated into wp-admin. 15 * 16 * Copyright (C) 2014-2025 PRESSINFRA SRL <ping@presslabs.com> 17 * 18 * Gitium is free software: you can redistribute it and/or modify 19 * it under the terms of the GNU General Public License as published by 20 * the Free Software Foundation, either version 3 of the License, or 21 * any later version. 22 * 23 * Gitium is distributed in the hope that it will be useful, 24 * but WITHOUT ANY WARRANTY; without even the implied warranty of 25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 26 * GNU General Public License for more details. 27 * 28 * You should have received a copy of the GNU General Public License 29 * along with Gitium. If not, see <http://www.gnu.org/licenses/>. 30 * 31 * @package Gitium 11 32 */ 12 /* Copyright 2014-2024 Presslabs <ping@presslabs.com>13 14 This program is free software; you can redistribute it and/or modify15 it under the terms of the GNU General Public License, version 2, as16 published by the Free Software Foundation.17 18 This program is distributed in the hope that it will be useful,19 but WITHOUT ANY WARRANTY; without even the implied warranty of20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the21 GNU General Public License for more details.22 23 You should have received a copy of the GNU General Public License24 along with this program; if not, write to the Free Software25 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA26 */27 33 28 34 define( 'GITIUM_LAST_COMMITS', 20 ); -
gitium/trunk/inc/class-git-wrapper.php
r3146858 r3255346 1 1 <?php 2 /* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com> 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License, version 2, as 6 published by the Free Software Foundation. 7 8 This program is distributed in the hope that it will be useful, 9 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 GNU General Public License for more details. 12 13 You should have received a copy of the GNU General Public License 14 along with this program; if not, write to the Free Software 15 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 */ 2 /** 3 * Gitium provides automatic git version control and deployment for 4 * your plugins and themes integrated into wp-admin. 5 * 6 * Copyright (C) 2014-2025 PRESSINFRA SRL <ping@presslabs.com> 7 * 8 * Gitium is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation, either version 3 of the License, or 11 * any later version. 12 * 13 * Gitium is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with Gitium. If not, see <http://www.gnu.org/licenses/>. 20 * 21 * @package Gitium 22 */ 17 23 18 24 if (!defined('GITIGNORE')) -
gitium/trunk/inc/class-gitium-admin.php
r1528380 r3255346 1 1 <?php 2 /* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com> 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License, version 2, as 6 published by the Free Software Foundation. 7 8 This program is distributed in the hope that it will be useful, 9 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 GNU General Public License for more details. 12 13 You should have received a copy of the GNU General Public License 14 along with this program; if not, write to the Free Software 15 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 */ 17 2 /** 3 * Gitium provides automatic git version control and deployment for 4 * your plugins and themes integrated into wp-admin. 5 * 6 * Copyright (C) 2014-2025 PRESSINFRA SRL <ping@presslabs.com> 7 * 8 * Gitium is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation, either version 3 of the License, or 11 * any later version. 12 * 13 * Gitium is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with Gitium. If not, see <http://www.gnu.org/licenses/>. 20 * 21 * @package Gitium 22 */ 18 23 class Gitium_Admin { 19 24 -
gitium/trunk/inc/class-gitium-help.php
r1435980 r3255346 1 1 <?php 2 /* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com> 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License, version 2, as 6 published by the Free Software Foundation. 7 8 This program is distributed in the hope that it will be useful, 9 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 GNU General Public License for more details. 12 13 You should have received a copy of the GNU General Public License 14 along with this program; if not, write to the Free Software 15 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 */ 2 /** 3 * Gitium provides automatic git version control and deployment for 4 * your plugins and themes integrated into wp-admin. 5 * 6 * Copyright (C) 2014-2025 PRESSINFRA SRL <ping@presslabs.com> 7 * 8 * Gitium is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation, either version 3 of the License, or 11 * any later version. 12 * 13 * Gitium is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with Gitium. If not, see <http://www.gnu.org/licenses/>. 20 * 21 * @package Gitium 22 */ 17 23 18 24 class Gitium_Help { -
gitium/trunk/inc/class-gitium-menu-bubble.php
r1528380 r3255346 1 1 <?php 2 /* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com> 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License, version 2, as 6 published by the Free Software Foundation. 7 8 This program is distributed in the hope that it will be useful, 9 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 GNU General Public License for more details. 12 13 You should have received a copy of the GNU General Public License 14 along with this program; if not, write to the Free Software 15 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 */ 2 /** 3 * Gitium provides automatic git version control and deployment for 4 * your plugins and themes integrated into wp-admin. 5 * 6 * Copyright (C) 2014-2025 PRESSINFRA SRL <ping@presslabs.com> 7 * 8 * Gitium is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation, either version 3 of the License, or 11 * any later version. 12 * 13 * Gitium is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with Gitium. If not, see <http://www.gnu.org/licenses/>. 20 * 21 * @package Gitium 22 */ 17 23 18 24 class Gitium_Menu_Bubble extends Gitium_Menu { -
gitium/trunk/inc/class-gitium-menu.php
r3146858 r3255346 1 1 <?php 2 /* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com> 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License, version 2, as 6 published by the Free Software Foundation. 7 8 This program is distributed in the hope that it will be useful, 9 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 GNU General Public License for more details. 12 13 You should have received a copy of the GNU General Public License 14 along with this program; if not, write to the Free Software 15 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 */ 2 /** 3 * Gitium provides automatic git version control and deployment for 4 * your plugins and themes integrated into wp-admin. 5 * 6 * Copyright (C) 2014-2025 PRESSINFRA SRL <ping@presslabs.com> 7 * 8 * Gitium is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation, either version 3 of the License, or 11 * any later version. 12 * 13 * Gitium is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with Gitium. If not, see <http://www.gnu.org/licenses/>. 20 * 21 * @package Gitium 22 */ 17 23 18 24 class Gitium_Menu { -
gitium/trunk/inc/class-gitium-requirements.php
r1533681 r3255346 1 1 <?php 2 /* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com> 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License, version 2, as 6 published by the Free Software Foundation. 7 8 This program is distributed in the hope that it will be useful, 9 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 GNU General Public License for more details. 12 13 You should have received a copy of the GNU General Public License 14 along with this program; if not, write to the Free Software 15 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 */ 2 /** 3 * Gitium provides automatic git version control and deployment for 4 * your plugins and themes integrated into wp-admin. 5 * 6 * Copyright (C) 2014-2025 PRESSINFRA SRL <ping@presslabs.com> 7 * 8 * Gitium is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation, either version 3 of the License, or 11 * any later version. 12 * 13 * Gitium is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with Gitium. If not, see <http://www.gnu.org/licenses/>. 20 * 21 * @package Gitium 22 */ 17 23 18 24 class Gitium_Requirements { -
gitium/trunk/inc/class-gitium-submenu-commits.php
r1473078 r3255346 1 1 <?php 2 /* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com> 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License, version 2, as 6 published by the Free Software Foundation. 7 8 This program is distributed in the hope that it will be useful, 9 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 GNU General Public License for more details. 12 13 You should have received a copy of the GNU General Public License 14 along with this program; if not, write to the Free Software 15 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 */ 2 /** 3 * Gitium provides automatic git version control and deployment for 4 * your plugins and themes integrated into wp-admin. 5 * 6 * Copyright (C) 2014-2025 PRESSINFRA SRL <ping@presslabs.com> 7 * 8 * Gitium is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation, either version 3 of the License, or 11 * any later version. 12 * 13 * Gitium is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with Gitium. If not, see <http://www.gnu.org/licenses/>. 20 * 21 * @package Gitium 22 */ 17 23 18 24 class Gitium_Submenu_Commits extends Gitium_Menu { -
gitium/trunk/inc/class-gitium-submenu-configure.php
r3146858 r3255346 1 1 <?php 2 /* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com> 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License, version 2, as 6 published by the Free Software Foundation. 7 8 This program is distributed in the hope that it will be useful, 9 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 GNU General Public License for more details. 12 13 You should have received a copy of the GNU General Public License 14 along with this program; if not, write to the Free Software 15 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 */ 2 /** 3 * Gitium provides automatic git version control and deployment for 4 * your plugins and themes integrated into wp-admin. 5 * 6 * Copyright (C) 2014-2025 PRESSINFRA SRL <ping@presslabs.com> 7 * 8 * Gitium is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation, either version 3 of the License, or 11 * any later version. 12 * 13 * Gitium is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with Gitium. If not, see <http://www.gnu.org/licenses/>. 20 * 21 * @package Gitium 22 */ 17 23 18 24 class Gitium_Submenu_Configure extends Gitium_Menu { … … 153 159 <td> 154 160 <p> 155 <input type="text" class="regular-text" name="key_pair" id="key_pair" value="<?php echo esc_attr( $git_public_key ); ?>" readonly="readonly"> 156 <input type="submit" name="GitiumSubmitRegenerateKeypair" class="button" value="<?php _e( 'Regenerate Key', 'gitium' ); ?>" /> 161 <input type="text" class="regular-text" name="key_pair" id="key_pair" value="<?php echo esc_attr( $git_public_key ); ?>" readonly="readonly"> 162 <input type="submit" name="GitiumSubmitRegenerateKeypair" class="button" value="<?php _e( 'Regenerate Key', 'gitium' ); ?>" /> 163 </p> 164 <p> 165 <div> 166 <button id="copyButton" class="button" data-copy-text="<?php echo esc_attr($git_public_key); ?>">Copy Key Pair</button> 167 </div> 157 168 </p> 158 169 <p class="description"><?php _e( 'If your code use ssh keybased authentication for git you need to allow write access to your repository using this key.', 'gitium' ); ?><br /> -
gitium/trunk/inc/class-gitium-submenu-settings.php
r3146858 r3255346 1 1 <?php 2 /* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com> 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License, version 2, as 6 published by the Free Software Foundation. 7 8 This program is distributed in the hope that it will be useful, 9 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 GNU General Public License for more details. 12 13 You should have received a copy of the GNU General Public License 14 along with this program; if not, write to the Free Software 15 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 */ 2 /** 3 * Gitium provides automatic git version control and deployment for 4 * your plugins and themes integrated into wp-admin. 5 * 6 * Copyright (C) 2014-2025 PRESSINFRA SRL <ping@presslabs.com> 7 * 8 * Gitium is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation, either version 3 of the License, or 11 * any later version. 12 * 13 * Gitium is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with Gitium. If not, see <http://www.gnu.org/licenses/>. 20 * 21 * @package Gitium 22 */ 17 23 18 24 class Gitium_Submenu_Settings extends Gitium_Menu { … … 64 70 <td> 65 71 <p><code id="webhook-url"><?php echo esc_url( gitium_get_webhook() ); ?></code> 66 <?php if ( ! defined( 'GIT_WEBHOOK_URL' ) || GIT_WEBHOOK_URL == '' ) : ?> 67 <input type="submit" name="GitiumSubmitRegenerateWebhook" class="button" value="<?php _e( 'Regenerate Webhook', 'gitium' ); ?>" /> 68 <a class="button" href="<?php echo esc_url( gitium_get_webhook() ); ?>" target="_blank">Merge changes</a></p> 69 <?php endif; ?> 70 <p class="description"><?php _e( 'Pinging this URL triggers an update from remote repository.', 'gitium' ); ?></p> 72 <?php if ( ! defined( 'GIT_WEBHOOK_URL' ) || GIT_WEBHOOK_URL == '' ) : ?> 73 <input type="submit" name="GitiumSubmitRegenerateWebhook" class="button" value="<?php _e( 'Regenerate Webhook', 'gitium' ); ?>" /> 74 <a class="button" href="<?php echo esc_url( gitium_get_webhook() ); ?>" target="_blank">Merge changes</a></p> 75 <?php endif; ?> 76 <p> 77 <div> 78 <button id="copyButton" class="button" data-copy-text="<?php echo esc_url( gitium_get_webhook() ) ?>">Copy Webhook URL</button> 79 </div> 80 </p> 81 <p class="description"><?php _e( 'Pinging this URL triggers an update from remote repository.', 'gitium' ); ?></p> 71 82 </td> 72 83 </tr> -
gitium/trunk/inc/class-gitium-submenu-status.php
r3146858 r3255346 1 1 <?php 2 /* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com> 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License, version 2, as 6 published by the Free Software Foundation. 7 8 This program is distributed in the hope that it will be useful, 9 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 GNU General Public License for more details. 12 13 You should have received a copy of the GNU General Public License 14 along with this program; if not, write to the Free Software 15 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 */ 2 /** 3 * Gitium provides automatic git version control and deployment for 4 * your plugins and themes integrated into wp-admin. 5 * 6 * Copyright (C) 2014-2025 PRESSINFRA SRL <ping@presslabs.com> 7 * 8 * Gitium is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation, either version 3 of the License, or 11 * any later version. 12 * 13 * Gitium is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with Gitium. If not, see <http://www.gnu.org/licenses/>. 20 * 21 * @package Gitium 22 */ 17 23 18 24 class Gitium_Submenu_Status extends Gitium_Menu { … … 95 101 96 102 public function save_changes() { 97 $gitium_save_changes = filter_input(INPUT_POST, 'GitiumSubmitSaveChanges', FILTER_SANITIZE_FULL_SPECIAL_CHARS);103 $gitium_save_changes = filter_input(INPUT_POST, 'GitiumSubmitSaveChanges', FILTER_SANITIZE_FULL_SPECIAL_CHARS); 98 104 $gitium_commit_msg = filter_input(INPUT_POST, 'commitmsg', FILTER_SANITIZE_FULL_SPECIAL_CHARS); 99 if ( ! isset( $gitium_save_changes ) ) { 105 106 if ( ! isset( $gitium_save_changes ) ) { 100 107 return; 101 108 } 109 102 110 check_admin_referer( 'gitium-admin' ); 103 111 104 112 gitium_enable_maintenance_mode() or wp_die( __( 'Could not enable the maintenance mode!', 'gitium' ) ); 105 $this->git->add();113 106 114 $commitmsg = sprintf( __( 'Merged changes from %s on %s', 'gitium' ), get_site_url(), date( 'm.d.Y' ) ); 115 107 116 if ( isset( $gitium_commit_msg ) && ! empty( $gitium_commit_msg ) ) { 108 117 $commitmsg = $gitium_commit_msg; 109 118 } 119 120 $commits = array(); 121 110 122 $current_user = wp_get_current_user(); 111 $commit = $this->git->commit( $commitmsg, $current_user->display_name, $current_user->user_email ); 112 if ( ! $commit ) { 113 $this->redirect( __( 'Could not commit!', 'gitium' ) ); 114 } 115 $merge_success = gitium_merge_and_push( $commit ); 123 124 // Get local status and behind commits 125 $local_status = $this->git->local_status(); 126 $behind_commits = count( $this->git->get_behind_commits() ); 127 128 if ( $this->git->is_dirty() && $this->git->add() > 0 ) { 129 $commit = $this->git->commit( $commitmsg, $current_user->display_name, $current_user->user_email ); 130 if ( ! $commit ) { 131 gitium_disable_maintenance_mode(); 132 $this->redirect( __( 'Could not commit!', 'gitium' ) ); 133 } 134 $commits[] = $commit; 135 } 136 137 $merge_success = gitium_merge_and_push( $commits ); 138 116 139 gitium_disable_maintenance_mode(); 140 117 141 if ( ! $merge_success ) { 118 142 $this->redirect( __( 'Merge failed: ', 'gitium' ) . $this->git->get_last_error() ); 119 143 } 120 $this->success_redirect( sprintf( __( 'Pushed commit: `%s`', 'gitium' ), $commitmsg ) ); 144 145 // Determine message based on previous conditions 146 if ( $behind_commits > 0 && empty( $local_status[1] ) ) { 147 $this->success_redirect( sprintf( __( 'Pull done!', 'gitium' ) ) ); 148 } else{ 149 $this->success_redirect( sprintf( __( 'Pushed commit: `%s`', 'gitium' ), $commitmsg ) ); 150 } 121 151 } 122 152 … … 194 224 <?php 195 225 } 196 197 private function show_git_changes_table_submit_buttons( $changes ) { 198 if ( ! empty( $changes ) ) : ?> 199 <p> 200 <label for="save-changes"><?php _e( 'Commit message', 'gitium' ); ?>:</label> 201 <input type="text" name="commitmsg" id="save-changes" class="widefat" value="" placeholder="<?php printf( __( 'Merged changes from %s on %s', 'gitium' ), get_site_url(), date( 'm.d.Y' ) ); ?>" /> 202 </p> 203 <p> 204 <input type="submit" name="GitiumSubmitSaveChanges" class="button-primary button" value="<?php _e( 'Save changes', 'gitium' ); ?>" <?php if ( get_transient( 'gitium_remote_disconnected' ) ) { echo 'disabled="disabled" '; } ?>/> 205 </p> 206 <?php endif; 207 } 226 227 private function show_git_changes_table_submit_buttons( $changes ) { 228 // Get local status and behind commits 229 $local_status = $this->git->local_status(); 230 $behind_commits = count( $this->git->get_behind_commits() ); 231 232 // Determine button value based on conditions 233 if ( $behind_commits > 0 && !empty( $local_status[1] ) ) { 234 $button_value = __( 'Pull & Push changes', 'gitium' ); 235 } else if ( $behind_commits > 0 ) { 236 $button_value = __( 'Pull changes', 'gitium' ); 237 } else if ( !empty( $local_status[1] ) ) { 238 $button_value = __( 'Push changes', 'gitium' ); 239 } 240 241 // Check if there are any changes to display the form 242 if ( !empty( $changes ) ) : ?> 243 <p> 244 <label for="save-changes"><?php _e( 'Commit message', 'gitium' ); ?>:</label> 245 <input type="text" name="commitmsg" id="save-changes" class="widefat" value="" placeholder="<?php printf( __( 'Merged changes from %s on %s', 'gitium' ), get_site_url(), date( 'm.d.Y' ) ); ?>" /> 246 </p> 247 <p> 248 <input type="submit" name="GitiumSubmitSaveChanges" class="button-primary button" value="<?php echo esc_html( $button_value ); ?>" <?php if ( get_transient( 'gitium_remote_disconnected' ) ) { echo 'disabled="disabled" '; } ?>/> 249 </p> 250 <?php endif; 251 } 208 252 209 253 private function changes_page() { -
gitium/trunk/readme.txt
r3146858 r3255346 5 5 Tags: git, version, versioning, deployment, version-control, github, bitbucket, travis, code, revision, testing, development, branch, production, staging, debug, plugin, gitium, presslabs, simple 6 6 Requires at least: 4.7 7 Tested up to: 6. 68 Requires PHP: 5.69 License: GPLv 210 Stable tag: 1. 0.77 Tested up to: 6.7.2 8 Requires PHP: 7.4 9 License: GPLv3 10 Stable tag: 1.2.0 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html 12 12 … … 123 123 124 124 == Upgrade Notice == 125 = 1. 0.7=126 PHP8.1 compatibility, check if gitignore is already defined and add HOME env 125 = 1.2.0 = 126 Updated licenses to GPLv3. Updated the check for the wp-load.php file. 127 127 128 128 == Changelog == 129 130 = 1.2.0 = 131 * Changed the license for all files to GPLv3 132 * Fix: In some cases, the WP is configured in another folder. We've made some changes on how we check for the wp-load.php file 133 134 = 1.1.0 = 135 * Fix: In some cases, the website was stuck in maintenance when it was pulling the changes from remote 136 * Added: A copy-to-clipboard button was introduced for copying ssh key-pair and webhook url 129 137 130 138 = 1.0.7 =
Note: See TracChangeset
for help on using the changeset viewer.