Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: dubinc-plugin
path: dubinc.zip
name: dubinc
path: /tmp/dubinc
retention-days: 30
2 changes: 1 addition & 1 deletion assets/js/admin/dubco-meta-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ window.jQuery(document).ready(function ($) {
}
} catch (error) {
console.error(error);
$('#dubco_error').addClass('error').text(error).show();
$('#dubco_error').addClass('error').text(error?.message || error).show();
} finally {
$(this).text(wp.i18n.__('Update', 'dubinc'));
}
Expand Down
7 changes: 2 additions & 5 deletions assets/js/editor/components/dubco-side-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ const MetaBox = ({ postStatus, metaFields, setMetaFields, postId }) => {
const [error, setError] = useState('');
const [isLoading, setIsLoading] = useState(false);

const { _dubco_short_url, _dubco_short_url_id, _dubco_short_url_error } =
metaFields;
const { _dubco_short_url, _dubco_short_url_id, _dubco_short_url_error } = metaFields;

useEffect(() => {
if (_dubco_short_url) {
Expand Down Expand Up @@ -120,9 +119,7 @@ const MetaBox = ({ postStatus, metaFields, setMetaFields, postId }) => {
)}
</div>
{error && <Notice status="error">{error}</Notice>}
<AnalitycsLink
shortLink={_dubco_short_url}
/>
<AnalitycsLink shortLink={_dubco_short_url} />
</>
)}
{!_dubco_short_url && (
Expand Down
2 changes: 1 addition & 1 deletion dist/js/editor.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => '5605b62c6a63015b5f7b');
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => '25e82788ac7ce4ccbfb3');
2 changes: 1 addition & 1 deletion dist/js/editor.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions includes/classes/Rest/Links.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function register_routes() {

register_rest_route(
'dubco/v1',
'/links/(?P<id>[a-zA-Z0-9]+)',
'/links/(?P<id>[a-zA-Z0-9_]+)',
[
'methods' => WP_REST_Server::EDITABLE,
'callback' => [ $this, 'update_link' ],
Expand Down Expand Up @@ -61,7 +61,6 @@ public function create_link( $request ) {
}

public function update_link( $request ) {
// Handle PATCH request to update an existing link
$id = $request->get_param( 'id' );
$params = $request->get_params();

Expand All @@ -86,7 +85,6 @@ public function update_link( $request ) {
}

public function permissions_check( $request ) {
// Check if the user has permission to perform the action
return current_user_can( 'edit_posts' );
}
}
62 changes: 31 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
{
"name": "dubinc",
"version": "1.0.0",
"scripts": {
"start": "npm run watch",
"watch": "10up-toolkit watch --port=5010 --hot",
"build": "10up-toolkit build",
"format-js": "10up-toolkit format-js",
"lint-js": "10up-toolkit lint-js",
"lint-style": "10up-toolkit lint-style",
"lint-php": "./vendor/bin/phpcs ./includes --standard=ruleset.xml",
"fix-php": "./vendor/bin/phpcbf ./includes --standard=ruleset.xml",
"test": "10up-toolkit test-unit-jest",
"clean-dist": "rm -rf ./dist"
},
"engines": {
"node": ">=18.0.0"
},
"devDependencies": {
"10up-toolkit": "^6.2.0"
},
"dependencies": {
"prop-types": "^15.7.2"
},
"10up-toolkit": {
"entry": {
"admin": "./assets/js/admin/admin.js",
"frontend": "./assets/js/frontend/frontend.js",
"shared": "./assets/js/shared/shared.js",
"editor": "./assets/js/editor/index.js"
"name": "dubinc",
"version": "1.0.0",
"scripts": {
"start": "npm run watch",
"watch": "10up-toolkit watch --port=5010",
"build": "10up-toolkit build",
"format-js": "10up-toolkit format-js",
"lint-js": "10up-toolkit lint-js",
"lint-style": "10up-toolkit lint-style",
"lint-php": "./vendor/bin/phpcs ./includes --standard=ruleset.xml",
"fix-php": "./vendor/bin/phpcbf ./includes --standard=ruleset.xml",
"test": "10up-toolkit test-unit-jest",
"clean-dist": "rm -rf ./dist"
},
"engines": {
"node": ">=18.0.0"
},
"devDependencies": {
"10up-toolkit": "^6.2.0"
},
"dependencies": {
"prop-types": "^15.7.2"
},
"10up-toolkit": {
"entry": {
"admin": "./assets/js/admin/admin.js",
"frontend": "./assets/js/frontend/frontend.js",
"shared": "./assets/js/shared/shared.js",
"editor": "./assets/js/editor/index.js"
}
}
}
}
}